xxxxxxxxxx
stringValue = Convert.ToString(Convert.ToInt32(stringValue , 2) , 16).ToUpper();
// The first "Convert.ToString()" is converting decimal into hexadecimal
// The second "Convert.ToInt32()" is converting binary into decimal
xxxxxxxxxx
private string hex2binary(string hexvalue){ string binaryval = ""; binaryval = Convert.ToString(Convert.ToInt32(hexvalue, 16), 2); return binaryval;}