PROTECTED]
Subject: Re: [ADVANCED-DOTNET] Binary data to string representation of
hex values
There is also BitConverter.ToString( byte[] value ). Unfortunately, this
method returns a string with each hexadecimal pair separated by hyphens
(e.g. 2A-1B-AA) which is almost invariably NOT what I need
There is also BitConverter.ToString( byte[] value ). Unfortunately, this
method returns a string with each hexadecimal pair separated by hyphens
(e.g. 2A-1B-AA) which is almost invariably NOT what I need. But maybe it
will do for you.
Regards,
Fernando Tubio
- Original Message -
From: "A
Chad,
Yes, you're right. 00 0A is what I should have said was the output I
expected. Thanks for all your help!
===
This list is hosted by DevelopMentorĀ® http://www.develop.com
NEW! ASP.NET courses you may be interested in:
2 Days of ASP.NET, 29 Sept 2003, in Red
Ryan, Yes, this is what I was trying to say. I'll try the suggestions.
Thanks!
===
This list is hosted by DevelopMentorĀ® http://www.develop.com
NEW! ASP.NET courses you may be interested in:
2 Days of ASP.NET, 29 Sept 2003, in Redmond
http://www.develop.com/course
I'm not sure exactly what you are referring to here but I am assuming that
you are receiving data from an api call that is a byte array, into a
string, and you want to create a hex string that represents the byte
data. If so, then this should do it depending on which Encoding will work
for you:
/
en Dunn
To: [EMAIL PROTECTED]
Sent: 24-09-2003 14:06
Subject: Re: [ADVANCED-DOTNET] Binary data to string representation of hex
values
Is your binary fixed length and what "endian" is it? I'm confused when
you
say that a binary of 0 and 10 is "0A". Surely this is "
Is your binary fixed length and what "endian" is it? I'm confused when you
say that a binary of 0 and 10 is "0A". Surely this is "02". I'm sure
there's something in STL that will help.
Cheers,
Steve.
p.s. reminds me of a strap-line I once see:
Understanding binary is as easy as 01 10 11 :)
Assuming that I understand
byte b[] = new byte[]{0,10};
string s = "";
for(int i=0 ; i < b.Length ; i++)
s=b[i].ToString("X") + s;
adam
Randy Collins wrote:
> I am calling a 3rd party win32 api function that is returning binary
> data from a mainframe into a StringBuilder type parameter. Thi