点击或拖拽改变大小

SoftBasicByteToHexString 方法 (Byte)

字节数据转化成16进制表示的字符串
Byte data into a string of 16 binary representations

命名空间:  HslCommunication.BasicFramework
程序集:  HslCommunication (在 HslCommunication.dll 中) 版本:12.0.0.0 (12.0.0.0)
语法
public static string ByteToHexString(
	byte[] InBytes
)

参数

InBytes
类型:SystemByte
字节数组

返回值

类型:String
返回的字符串
示例
ByteToHexString示例
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( );
参见