C# 各种进制转换

一、16进制文本转float

1 string hexString = "43480170";
2 uint num = uint.Parse(hexString, System.Globalization.NumberStyles.AllowHexSpecifier);
3 byte[] floatVals = BitConverter.GetBytes(num);
4 float f = BitConverter.ToSingle(floatVals, 0);
5 Console.WriteLine("float convert = {0}", f);

猜你喜欢

转载自www.cnblogs.com/CRISBLOG/p/11269575.html