-
VB.NET的字节校验例子
Function Verify(ByVal VerifyString As String) As String 第一个字节与字节“00”异或,结果与第二个字节异或,以此类推,至最后一个字节,并将最后异或结果表达为16进制ASCII字符 例: bn012000000000012008-01-15 20:42:3000c3@@@SO2,0,,BB,;NOx,0,,BB,;烟尘,0,,BB,;动压,0,,BB,;温度,0,,BB,;静压,0,,BB,;O2,0,,BB,;流速,0,;H2O,6.5,;流量,0,;过量空气系数,1,;SO2折算,0,;NOx折算,0,;烟尘折算,0,;SO2排放率,0,;NOx排放率,0,;烟尘排放率,0,;tek
其校验码为:20 Dim ChkXor = Encoding.Default.GetBytes(VerifyString) |