Html/CSS
下位机 标签描述

1、byte转String Encoding.ASCII.GetString(byte[]); 2、base64string转byte byte[]=Base64Decoder.Decoder.GetDecoded(string); 3、byte转UInt16 方法一 (UInt16)(bytes[0]256+bytes[1]) 方法二 (UInt16)((bytes[0]<<8)|bytes[1]); 方法三 字节序要对应上,下位机一般高字节在前,C这个函数是低字节在前 BitConverter.ToInt16(bytes); 4、byte转UInt32 (UInt32)((b...