Click here to Skip to main content
15,908,906 members
Home / Discussions / C#
   

C#

 
GeneralRe: Delete a directory Pin
MicealG17-May-07 5:18
MicealG17-May-07 5:18 
GeneralRe: Delete a directory Pin
MicealG17-May-07 5:22
MicealG17-May-07 5:22 
AnswerRe: Delete a directory Pin
Jimmanuel17-May-07 5:18
Jimmanuel17-May-07 5:18 
Questionhow to connect to http servers/My website and download the files Pin
pashitech17-May-07 4:16
pashitech17-May-07 4:16 
AnswerRe: how to connect to http servers/My website and download the files Pin
led mike17-May-07 4:42
led mike17-May-07 4:42 
GeneralRe: how to connect to http servers/My website and download the files Pin
pashitech17-May-07 5:03
pashitech17-May-07 5:03 
GeneralRe: how to connect to http servers/My website and download the files Pin
led mike17-May-07 6:16
led mike17-May-07 6:16 
QuestionStringBuilder and ASCII. [modified] Pin
Russell Jones17-May-07 3:20
Russell Jones17-May-07 3:20 
I've got a stringbuilder object back from a dll for which i don't have the source by using an API call. The api call is a blackbox I have no idea what happens inside it.

Inspecting the stringbuilder in VS shows the same result as inspecting the output in the VB6 app i am trying to copy.

I now need to perform a bitwise mask on each of the bytes in the stringbuilder as that is what the original app does.

How can i get a byte array of ASCII values out of a string builder?

I've tried these 2 approaches:
Encoding enc = Encoding.ASCII;
byte[] bytes = enc.GetBytes(text.ToString());
This overflows value bigger than unsigned byte...


for (int i = 0; i < text.Length; i++)
{
Console.WriteLine(text[i] + " " + Convert.ToByte(text[i]));
}
this produces output that doesn't seem to bear much relation to the input data.




I've tried these 2 approaches:
this produces output that doesn't seem to bear much relation to the input data.
Encoding enc = Encoding.ASCII;<br />
byte[] bytes =  enc.GetBytes(text.ToString());



This overflows value bigger than unsigned byte...
for (int i = 0; i < text.Length; i++)<br />
{<br />
   Console.WriteLine(text[i] + " " + Convert.ToByte(text[i]));<br />
}



Has anyone played with string compatability between VB6 and c#?

Russell




-- modified at 11:34 Thursday 17th May, 2007
AnswerRe: StringBuilder and ASCII. Pin
led mike17-May-07 4:54
led mike17-May-07 4:54 
GeneralRe: StringBuilder and ASCII. Pin
Russell Jones17-May-07 5:32
Russell Jones17-May-07 5:32 
QuestionNew in .NET 2.0 Pin
Blumen17-May-07 3:20
Blumen17-May-07 3:20 
AnswerRe: New in .NET 2.0 Pin
Christian Graus17-May-07 3:22
protectorChristian Graus17-May-07 3:22 
GeneralRe: New in .NET 2.0 Pin
Blumen17-May-07 3:27
Blumen17-May-07 3:27 
GeneralRe: New in .NET 2.0 Pin
Christian Graus17-May-07 3:30
protectorChristian Graus17-May-07 3:30 
GeneralRe: New in .NET 2.0 Pin
Judah Gabriel Himango17-May-07 5:18
sponsorJudah Gabriel Himango17-May-07 5:18 
AnswerRe: New in .NET 2.0 Pin
Russell Jones17-May-07 3:52
Russell Jones17-May-07 3:52 
AnswerRe: New in .NET 2.0 Pin
Nissim Salomon17-May-07 5:24
Nissim Salomon17-May-07 5:24 
Questionhow to get textbox control? Pin
newtocsharp17-May-07 3:14
newtocsharp17-May-07 3:14 
AnswerRe: how to get textbox control? Pin
Judah Gabriel Himango17-May-07 5:47
sponsorJudah Gabriel Himango17-May-07 5:47 
QuestionHelp needed to convert function to a generic function Pin
Jim Taylor17-May-07 3:11
Jim Taylor17-May-07 3:11 
AnswerRe: Help needed to convert function to a generic function Pin
Not Active17-May-07 4:12
mentorNot Active17-May-07 4:12 
GeneralRe: Help needed to convert function to a generic function Pin
Jim Taylor17-May-07 4:59
Jim Taylor17-May-07 4:59 
AnswerRe: Help needed to convert function to a generic function Pin
Judah Gabriel Himango17-May-07 5:11
sponsorJudah Gabriel Himango17-May-07 5:11 
GeneralRe: Help needed to convert function to a generic function Pin
Jim Taylor17-May-07 5:34
Jim Taylor17-May-07 5:34 
GeneralRe: Help needed to convert function to a generic function Pin
Not Active17-May-07 6:20
mentorNot Active17-May-07 6:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.