private void button1_Click(object sender, EventArgs e)
{
//UInt16 -> 两个byte;
UInt16 temp = 256;
byte a = (byte)(temp >> 8 & 0xff);
byte b = (byte)(temp & 0xff);
//两个byte -> UInt16;
UInt16 aa = Convert.ToUInt16((a << 8) + b);
}
{
//UInt16 -> 两个byte;
UInt16 temp = 256;
byte a = (byte)(temp >> 8 & 0xff);
byte b = (byte)(temp & 0xff);
//两个byte -> UInt16;
UInt16 aa = Convert.ToUInt16((a << 8) + b);
}