コード例 #1
0
 public void OpenCloseGate()
 {
     LogerHelper.DefaultInfo(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " 收到终端开门请求");
     try
     {
         Stream inputStream = Request.GetBufferedInputStream();
         //byte[] src = new byte[42];
         //int offset = 0;
         //int result = 0;
         //int cnt = 0;
         //while ((result = inputStream.ReadByte()) != -1)
         //{
         //    cnt++;
         //    src[offset] = (byte)result;
         //    offset++;
         //}
         // LogerHelper.debug("平台收到数据:"+ByteUtils.byteToHexStr(src));
         OpenOrCloseGateRequest opens = RealTimeAnalysis.openOrCloseGate(inputStream);
         opens.CreateTime = DateTime.Now;
         orderbll.uploadOpenOrCloseGate(opens);
     }catch (Exception e) {
         LogHelper.Exception(this.Url.RequestContext, e);
     }
 }