一段代码求详细解释
itzrx 2009-04-15 02:20:19 下面 //// 内的代码没看懂,求详细解释!
byte[] btMsg, btBuf;
byte[] btSend;
char[] chBuf;
int iBt;
DateTime dtNow = DateTime.Now;
btMsg = new byte[] { 0, 0, 0, 0, 0, 0, 0, 0 };
//////////////////没看懂的内容///////////////////////
btBuf = Encoding.ASCII.GetBytes(dtNow.Second.ToString("X2"));
chBuf = Encoding.ASCII.GetChars(btBuf);
iBt = Convert.ToInt16(chBuf[0]);
iBt <<= 4; // 为什么要这么做?
iBt += Convert.ToInt16(chBuf[1]);
btMsg[0] = (byte)iBt; // 还有这个,大于255的数转成 byte 有什么作用?
/////////////////////////////////////////