C# 高低位获取

ushort Tbed = 2255;
byte gao = (byte)(Tbed >> 8);
byte di = (byte)(Tbed & 0xff);

ushort a = (ushort)(gao << 8);
ushort b = (ushort)di;
//ushort newBed = (ushort)(a | di);

ushort newT = (ushort)(gao << 8 | di);

原文地址:https://www.cnblogs.com/LCLBook/p/12068289.html