考虑以下信息字节= 8位,但为什么不BitConverter这么认为
Public Enum Request As Byte
None = 0
Identity = 1
License = 2
End Enum
Protected mType As Communication.Request
mType = Communication.Request.Identity
Debug.Print (BitConverter.GetBytes(mType).Length.tostring)
2
为什么bitconverter报告说,M型是我本来以为是2的长度传递一个字节到BitConverter.GetBytes只会返回字节。
我的意思是没什么大不了的,因为它只是通过一个TCP套接字发送一个非常小的数据块,但我只是很好奇它为什么认为它是2个字节。
你真是幸运,一个字节是8的倍数。有时它是6,7或9位。 – WhirlWind 2010-04-09 02:48:29