在c#中解析/转换/操作十六进制值的任何提示?
特别是我想将十进制int转换为十六进制,然后输出为字符串...
答案 0 :(得分:1)
Int32 decValue = 42;
string hexValue = decValue.ToString("X");
Int32 decValue2 = Int32.Parse(hexValue, System.Globalization.NumberStyles.HexNumber);
见这篇文章:
How to convert numbers between hexadecimal and decimal in C#?
答案 1 :(得分:0)