Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, it is possible under C# to w

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi,

it is possible under C# to write any bytes hexadecimal into a stream like MemoryStream?
 
Try something like this:
Code:
StringWriter sw = new StringWriter();
int iTest = 234234;
sw.Write(iTest.ToString("X"));
Be aware that the numeric formatter is subject to your thread's current culture. Probably not a problem with hexadecimal, but if you were using the "N" formatter specification, the German culture would use decimal points for thousand-separators, and a comma for the decimal point.

See:

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top