Hi there. I have program in C#. I want to convert an int to HEX and after that convert it to a byte. But there is a problem in the 3rd line:
int i = 10;
string str = i.ToString("X");
byte b = Convert.ToByte(str);
Please help me.
Hi there. I have program in C#. I want to convert an int to HEX and after that convert it to a byte. But there is a problem in the 3rd line:
int i = 10;
string str = i.ToString("X");
byte b = Convert.ToByte(str);
Please help me.
uint ui = 0;
ui = checked((uint)System.Convert.ToUInt32("10"));
Console.WriteLine(String.Format("{0:x2}", ui));