By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,960 Members | 2,241 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,960 IT Pros & Developers. It's quick & easy.

Convert to hex and write to file

P: n/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

Sep 28 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"AMP" <am******@gmail.comwrote in message
news:11*********************@k70g2000cwa.googlegro ups.com...
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

Sep 28 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.