首页 > 技术文章 > 16进制赚ASCII其他可根据此思路区写

1GB-wjw 2021-09-15 14:03 原文

int aa = Int32.Parse("31", System.Globalization.NumberStyles.HexNumber);
int bb = Int32.Parse("32", System.Globalization.NumberStyles.HexNumber);
int cc = Int32.Parse("33", System.Globalization.NumberStyles.HexNumber);
byte[] myBytes = new byte[3] { 1,2,3 };
myBytes[0] = (byte)(Convert.ToInt32(aa));
myBytes[1] = (byte)(Convert.ToInt32(bb));
myBytes[2] = (byte)(Convert.ToInt32(cc));
string sss = System.Text.Encoding.ASCII.GetString(myBytes);

推荐阅读