SoftBasicIsTwoBytesEquel 方法 (Byte, Int32, Byte, Int32, Int32) |
判断两个字节的指定部分是否相同
Determines whether the specified portion of a two-byte is the same
命名空间:
HslCommunication.BasicFramework
程序集:
HslCommunication (在 HslCommunication.dll 中) 版本:12.1.2.0 (12.1.2.0)
语法 public static bool IsTwoBytesEquel(
byte[] b1,
int start1,
byte[] b2,
int start2,
int length
)
Public Shared Function IsTwoBytesEquel (
b1 As Byte(),
start1 As Integer,
b2 As Byte(),
start2 As Integer,
length As Integer
) As Boolean
public:
static bool IsTwoBytesEquel(
array<unsigned char>^ b1,
int start1,
array<unsigned char>^ b2,
int start2,
int length
)
static member IsTwoBytesEquel :
b1 : byte[] *
start1 : int *
b2 : byte[] *
start2 : int *
length : int -> bool
参数
- b1
- 类型:SystemByte
第一个字节 - start1
- 类型:SystemInt32
第一个字节的起始位置 - b2
- 类型:SystemByte
第二个字节 - start2
- 类型:SystemInt32
第二个字节的起始位置 - length
- 类型:SystemInt32
校验的长度
返回值
类型:
Boolean返回是否相等
异常 异常 | 条件 |
---|
IndexOutOfRangeException | |
示例 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 ) );
参见