1. BitConverter.ToString 方法 (Byte[], Int32, Int32)
public static string ToString (byte[] value,int startIndex,int length)
参数
value 字节数组。
startIndex value 内的起始位置。
length 要转换的字节数。
返回值
由以连字符分隔的十六进制对构成的 String,其中每一对表示 value 中对应的元素;例如“7F-2C-4A”。
2. Encoding.GetString 方法 (Byte[], Int32, Int32)
public virtual string GetString (byte[] bytes,int index,int count)
参数
bytes 包含要解码的字节序列的字节数组。
index 第一个要解码的字节的索引。
count 要解码的字节数。
返回值
包含指定字节序列解码结果的 String。