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