Vb.net 左移给出了错误的结果

Vb.net 左移给出了错误的结果,vb.net,bit-shift,Vb.net,Bit Shift,这是我的密码: dim message as byte() = {5,4,3,2,1} dim result = 244 dim result2 = 244 result = result + CUInt(CUInt(message(4) << 8)) result2 = result2 + CUInt(CUInt(1 << 8)) console.WriteLine(result) Console.WriteLine(result2) 我不明白为什么即使消息(4)

这是我的密码:

dim message as byte() = {5,4,3,2,1}
dim result = 244
dim result2 = 244
result = result + CUInt(CUInt(message(4) << 8))
result2 = result2 + CUInt(CUInt(1 << 8))  
console.WriteLine(result)
Console.WriteLine(result2)
我不明白为什么即使
消息(4)
等于
1
为什么我没有得到预期的结果。

result2
给出了预期的结果,但我希望能够直接从数组中读取值。

这是一个编码错误

正确的代码是 结果=结果+提示(提示(消息(4))
 245  
 500