I want to Convert hexadecimal numbers to binary numbers.I search some posts but couldn't find a c# language program.
I used this:
value = 0xFFFF;
decimalNum = Convert.ToString(value, 16);
Console.WriteLine(value);
and then I converted it to binary number. Are there any easier and fast way to do this?
You can do this:
var value = 0xFFFF;
value = Convert.ToString(Convert.ToInt32(value.ToString(), 16), 2);
Console.WriteLine(value);
// 1100101010100110101
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With