Convert to hex and write to file

A

AMP

Hello,
I have an Array of bytes that I want to fromat as Hex and print to a
file.
EX: bytenumbers[] = {1,3,5,34,65,78,234}
I want to format them as their hex values and tr.Write them as F0 12
A0...........
Any help would be appreciated
Thanks
Mike
 
N

Nicholas Paldino [.NET/C# MVP]

Mike,

You want to take a look at the overload of ToString which takes a string
parameter. Pass "X" for the parameter and you should get the string
representation in hex format.

Then, you can cycle through the bytes and write them to the file.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top