以下共三种方法:
byte[] data1=new byte[5];
data1[0] = 0x01;
data1[1] = 0x28;
//用byte[]数组直接做高低位转换
double res = (data1[0] * 0x100 + data1[1]) ;
//用 Convert.ToInt16参数控制转换的进制
string[] HexReceiveBuffer = new string[100];
HexReceiveBuffer[0] = data1[0].ToString("x");
HexReceiveBuffer[1] = data1[1].ToString("x");
string StrVal = HexReceiveBuffer[0] + HexReceiveBuffer[1];
int tem = Convert.ToInt16(StrVal, 16);
//使用BitConverter,将byte[]数组放置好高低位后,注意带转换的data2[0]是低位,[1]是高位
byte[] data2 = new byte[5];
data2[0] = data1[1];
data2[1] = data1[0];
short sValu = BitConverter.ToInt16(data2, 0);