点击或拖拽改变大小

SoftBasicIsTwoBytesEquel 方法 (Byte, Int32, Byte, Int32, Int32)

判断两个字节的指定部分是否相同
Determines whether the specified portion of a two-byte is the same

命名空间:  HslCommunication.BasicFramework
程序集:  HslCommunication (在 HslCommunication.dll 中) 版本:11.8.2.0 (11.8.2.0)
语法
public static bool IsTwoBytesEquel(
	byte[] b1,
	int start1,
	byte[] b2,
	int start2,
	int length
)

参数

b1
类型:SystemByte
第一个字节
start1
类型:SystemInt32
第一个字节的起始位置
b2
类型:SystemByte
第二个字节
start2
类型:SystemInt32
第二个字节的起始位置
length
类型:SystemInt32
校验的长度

返回值

类型:Boolean
返回是否相等
异常
异常条件
IndexOutOfRangeException
示例
IsTwoBytesEquel示例
byte[] b1 = new byte[] { 0x13, 0xA6, 0x15, 0x85, 0x5B, 0x05, 0x12, 0x36, 0xF2, 0x27 };
byte[] b2 = new byte[] { 0x12, 0xC6, 0x25, 0x3C, 0x42, 0x85, 0x5B, 0x05, 0x12, 0x87 };

Console.WriteLine( SoftBasic.IsTwoBytesEquel( b1, 3, b2, 5, 4 ) );

// 输出 true
参见