收藏 C#代码:十六进制浮点数转十进制数
using System.Reflection;
using System.Globalization;
string s = "477A45C2";
MatchCollection matches = Regex.Matches(s, @"[0-9A-Fa-f]{2}");
byte[] bytes = new byte[matches.Count];
for (int i = 0; i < bytes.Length; i++)
bytes[i]= byte.Parse(matches[i].Value, NumberStyles.AllowHexSpecifier);
float m = BitConverter.ToSingle(bytes, 0);
Response.Write(m);