/// <summary>
 /// 关闭串口
 /// </summary>
 private void CloseChuanKou()
 {
     try
     {
         if (TextGSM.IsOpen)
         {
             TextGSM.Close();
             TextGSM = null;
         }
     }
     catch (Exception)
     {; }
 }
示例#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()); }
 }
示例#3
0
文件: Form1.cs 项目: luobox/gsmmodem
 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;
         }
     }
 }
示例#4
0
 public void Stop()
 {
     gm.Close();
 }