private void StartForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     try
     {
         server.Stop();
         Process.GetCurrentProcess().Kill();
     }
     catch { }
 }
Example #2
0
 /// <summary>
 /// 结束事件
 /// </summary>
 protected override void OnStop()
 {
     try
     {
         _httpServer.Stop();
     }
     catch (Exception ex)
     {
         LogUtil.Error(ex.ToString());
     }
 }