Esempio n. 1
0
 private void SendUpdateNumberDeal(int number)
 {
     tb_DownLoadDescription.Text = string.Empty;
     ContentMessage("准备写入的数据。", Color.Black);
     try
     {
         byte[] by = PortAgreement.GetClientNumber(number);
         _m_Port.Write(by);
         ContentMessage("数据准备完成,发送数据。", Color.Black);
         if (_tiDelayTimeOut == null)
         {
             _tiDelayTimeOut           = new System.Timers.Timer(2000);
             _tiDelayTimeOut.AutoReset = false;
             _tiDelayTimeOut.Elapsed  += _tiDelayTimeOut_Elapsed;
         }
         _tiDelayTimeOut.Start();
     }
     catch (Exception ex)
     {
         LimitControl(true);
         ContentMessage("错误内容:" + ex.Message, Color.Red);
     }
 }