111,095
社区成员




var b = new byte[] { 0xeb, 0x1f };
Console.WriteLine(BitConverter.ToInt16(new byte[] { b[1], b[0] }, 0));
Console.WriteLine(Convert.ToInt16((b[0].ToString("X2") + b[1].ToString("X2")), 16));
Console.WriteLine((Int16)Convert.ToUInt16((b[0] << 8) + b[1]));
三种都可以
class Program
{
static void Main(string[] args)
{
byte b1 = 0xeb;
byte b2 = 0x1f;
UInt16 val = Convert.ToUInt16((b1 << 8) + b2);
Console.WriteLine((Int16)val);
Console.WriteLine(val.ToString("X"));
Console.ReadKey();
}
}