C#中十六进制数和十进制数如何相互转换?
最佳答案
要将十进制转换为十六进制,请执行...
string hexValue = decValue.ToString("X");
要从十六进制转换为十进制,请执行...
int decValue = int.Parse(hexValue, System.Globalization.NumberStyles.HexNumber);
或
int decValue = Convert.ToInt32(hexValue, 16);
关于c# - 如何在十六进制和十进制之间转换数字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74148/