- //字节数组buff 转 16进制字符串line
- line = BitConverter.ToString(buff, 0, Length);
- line.Split(new char[] { '-' }) ;
- //16进制字符串 转 字节数组
- buff=System.Text.Encoding.ASCII.GetBytes("0x00a18402")
- 或者
- Byte_data = Convert.ToByte(String_based16, 16);
- //字节数组 转 uint 等等
- pktTHDXP.DID = BitConverter.ToUInt32(buff, 0);