public void StopConnection() { try { theController.StopConnection(); } catch (ApplicationException ae) { throw new FaultException(ae.Message); } }
private void btnStopSms_Click(object sender, RoutedEventArgs e) { try { TheMachineController.StopTheSmsThread(); TheMachineController.StopConnection(); smsTimer.Stop(); btnSms.Content = "启动短信服务"; } catch (Exception ex) { MessageBox.Show(ex.Message); } }