SoftBasicByteToHexString 方法 (Byte, Char, Int32, String) |
字节数据转化成16进制表示的字符串
Byte data into a string of 16 binary representations
命名空间:
HslCommunication.BasicFramework
程序集:
HslCommunication (在 HslCommunication.dll 中) 版本:12.1.2.0 (12.1.2.0)
语法 public static string ByteToHexString(
byte[] InBytes,
char segment,
int newLineCount,
string format = "{0:X2}"
)
Public Shared Function ByteToHexString (
InBytes As Byte(),
segment As Char,
newLineCount As Integer,
Optional format As String = "{0:X2}"
) As String
public:
static String^ ByteToHexString(
array<unsigned char>^ InBytes,
wchar_t segment,
int newLineCount,
String^ format = L"{0:X2}"
)
static member ByteToHexString :
InBytes : byte[] *
segment : char *
newLineCount : int *
?format : string
(* Defaults:
let _format = defaultArg format "{0:X2}"
*)
-> string
参数
- InBytes
- 类型:SystemByte
字节数组 - segment
- 类型:SystemChar
分割符,如果设置为0,则没有分隔符信息 - newLineCount
- 类型:SystemInt32
每隔指定数量的时候进行换行,如果小于等于0,则不进行分行显示 - format (Optional)
- 类型:SystemString
格式信息,默认为{0:X2}
返回值
类型:
String返回的字符串
示例 byte[] b1 = new byte[] { 0x13, 0xA6, 0x15, 0x85, 0x5B, 0x05, 0x12, 0x36, 0xF2, 0x27 };
Console.WriteLine( SoftBasic.ByteToHexString( b1 ) );
参见