/// <summary>
 /// 关闭串口
 /// </summary>
 private void CloseChuanKou()
 {
     try
     {
         if (TextGSM.IsOpen)
         {
             TextGSM.Close();
             TextGSM = null;
         }
     }
     catch (Exception)
     {; }
 }
Example #2
0
 public void Stop()
 {
     try
     {
         if (gm.IsOpen)
         {
             gm.SmsRecieved -= new EventHandler(gm_SmsRecieved);
             gm.Close();
         }
     }
     catch (Exception ex)
     { Service.ServiceControl.log.Error(DateTime.Now + ex.ToString()); }
 }
Example #3
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (gm.IsOpen)
     {
         try
         {
             gm.Close();
             label3.Text      = "断开成功";
             label3.ForeColor = Color.Red;
         }
         catch
         {
             label3.Text      = "断开失败";
             label3.ForeColor = Color.Red;
         }
     }
 }
Example #4
0
 public void Stop()
 {
     gm.Close();
 }