【问题标题】:Hex operations in C# [duplicate]C#中的十六进制操作[重复]
【发布时间】:2010-09-16 11:21:56
【问题描述】:

关于在 c# 中解析/转换/操作十六进制值的任何提示?

特别是我想将十进制整数转换为十六进制,然后输出为字符串...

【问题讨论】:

    标签: c# hex


    【解决方案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#?

    【讨论】:

      猜你喜欢
      • 2017-09-28
      • 1970-01-01
      • 2012-10-16
      • 1970-01-01
      • 1970-01-01
      • 2011-06-01
      • 2011-10-01
      • 2016-01-27
      • 2011-04-07
      相关资源
      最近更新 更多