Ejemplo n.º 1
0
        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();
            };
        }
Ejemplo n.º 2
0
        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 { }
        }