请大侠帮我将C代码转换成VB.Net,谢谢!

2024-11-28 01:24:41
推荐回答(1个)
回答1:

public function Calculate_CRC8(byval crc as uint16,byval n as uint16) as uint16
dim i as uint16

crc=crc xor n

for i=0 to 7

if crc and 1 then

crc=(crc>>1) xor &H8c

else

crc=crc>>1

end if
next

return crc
end function