int d = 10;
//十进制转二进制字符串 Console.WriteLine(Convert.ToString(d,2));//输出: 1010//十进制转十六进制字符串Console.WriteLine(Convert.ToString(d,16));//输出: a//二进制字符串转十进制数string bin = "1010";Console.WriteLine(Convert.ToInt32(bin,2));//输出: 10//二进制字符串转十六进制数string bin = "1010";Console.WriteLine(string.Format("{0:x}",Convert.ToInt32(bin,2));//输出: a//十六进制转二进制字符串Console.WriteLine(Convert.ToString(0xa,2));//输出: 1010//MessageBox.Show(Convert.ToInt32(txtDaiZhuan.Text, 16).ToString()); //16进制转十进制//十六进制转十进制数Console.WriteLine(Convert.ToString(0xa,10));//输出: 10