Greets,
You can use the ToString() method of the Convert class to convert the
value to a string in a different base. The base should be either 2, 8, 10
or 16 for binary, octal, decimal and hexadecimal, respectively:
string bits = Convert.ToString(integerValue,2);
Regards,
Joe
"CSharpener" <cs********@softhome.net> wrote in message
news:9B**********************************@microsof t.com...
This should be *so* easy! How do I convert a Byte or int to a binary
string representation in C#?
In JavaScript, it goes like this for an int:
javascript:(123).toString(2)
or
javascript:(0xFE).toString(2)
No problem. So, how do I do the same in C#? What simple thing am I
missing?
CSharpener