MatchCollection mc = Regex.Matches(hexstring.ToString(), "[A-F0-9]{2}");
byte[] bytes = new byte[mc.Count];
for (int i = 0; i < mc.Count; i++){
bytes[i] = byte.Parse(mc[i].Value, System.Globalization.NumberStyles.HexNumber);
}
int sh = System.BitConverter.ToInt32(bytes, 0);
C#16进制转换为Int
最新推荐文章于 2024-04-30 10:34:08 发布