C# C语言写法
public byte[] GetByteByPoint(int point)
{
byte[] array = new byte[3];
array[0] = Convert.ToByte((point & 0xff0000) >> 16);
array[1] = Convert.ToByte((point & 0xff00) >> 8);
array[2] = Convert.ToByte(point & 0xff);
return array;
}
返回3个字节 0XFF000为滤码
C# 实现
public byte[] GetByteByPoint1(int point)
{
return BitConverter.GetBytes(System.Net.IPAddress.HostToNetworkOrder(point));
}
返回 4位