1、byte数组转string字符串,以16进制存储到字符串里
byte[] test = new frame[] { 0x00, 0x01, 0x00, 0x00, 0x00, 0x09, 0x01, 0x10, 0x9C, 0x41, 0x00, 0x01, 0x02, 0x16, 0x2E };
String res = "";
foreach (byte i in frame)
{
//string j = i.ToString("x");
res += String.Format("{0:X} ", i);//j);
}
Console.WriteLine(res);
输出结果:
0 1 0 0 0 12 1 10 9C 41 0 2 4 16 2E
===== {0},{1}02