c# - 如何将十六进制字符串转换为十进制

标签 c# hex converters

当我尝试这个时,

Decimal m = Decimal.Parse(columns[1], System.Globalization.NumberStyles.AllowHexSpecifier);

我得到一个 ArgumentException 说这个,

The number style AllowHexSpecifier is not supported on floating point data types.

和列 [1] = 4B414D000000011613C3 顺便说一句。

我做错了什么,我该如何解决?

最佳答案

Decimal 是浮点类型。尝试改用 int.Parse

关于c# - 如何将十六进制字符串转换为十进制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22559236/

相关文章:

c# - XmlSerializer 用问号替换非 ASCII 字符 '?'

c# - 如何在运行时更改补间动画的 endValueString?

C++ 十六进制字符串到 unsigned int

c# - LINQ to SQL 和不变性

c++ - 现成的 C++ 十六进制转储代码

c - 打开一个 png 文件并在 C 中读取它的十六进制值

python - 将 csv 转换为 json,用于 Python 或 PHP 中的 JavaScript 绘图库 Chartjs

ios - 核心音频 : Float32 to SInt16 conversion artefacts

javascript - 如何将二进制数据从binaryjs转换为字符串/文本

c# - Linq to Entity AcceptAllChanges 保存更改