public MainForm() { InitializeComponent(); this.ShowInTaskbar = false; this.WindowState = FormWindowState.Minimized; HideForm(); this.Text = Utils.GetVersion(); Global.processJob = new Job(); Application.ApplicationExit += (sender, args) => { v2rayHandler.V2rayStop(); HttpProxyHandle.CloseHttpAgent(config); PACServerHandle.Stop(); ConfigHandler.SaveConfig(ref config); statistics?.SaveToFile(); statistics?.Close(); }; }
private void MyAppExit(bool blWindowsShutDown) { try { v2rayHandler.V2rayStop(); //HttpProxyHandle.CloseHttpAgent(config); if (blWindowsShutDown) { HttpProxyHandle.ResetIEProxy4WindowsShutDown(); } else { HttpProxyHandle.UpdateSysProxy(config, true); } ConfigHandler.SaveConfig(ref config); statistics?.SaveToFile(); statistics?.Close(); } catch { } }