SoftBasicByteToHexString 方法 (Byte) |
命名空间: HslCommunication.BasicFramework
byte[] b1 = new byte[] { 0x13, 0xA6, 0x15, 0x85, 0x5B, 0x05, 0x12, 0x36, 0xF2, 0x27 }; Console.WriteLine( SoftBasic.ByteToHexString( b1 ) ); // 输出 "13A615855B051236F227"; Console.WriteLine( SoftBasic.ByteToHexString( b1, ' ' ) ); // 输出 "13 A6 15 85 5B 05 12 36 F2 27"; Console.WriteLine( SoftBasic.ByteToHexString( b1, ' ', -1, "0x{0:X2}" ) ); // 输出 "0x13 0xA6 0x15 0x85 0x5B 0x05 0x12 0x36 0xF2 0x27"; b1.ToHexString( );