Ejemplo n.º 1
0
        public MainForm()
        {
            InitializeComponent();
            this.ShowInTaskbar = false;
            this.WindowState   = FormWindowState.Minimized;
            HideForm();
            this.Text = Utils.GetVersion();

            Application.ApplicationExit += (sender, args) =>
            {
                Utils.ClearTempPath();
                statistics.Close();
            };
        }
Ejemplo n.º 2
0
        private void menuExit_Click(object sender, EventArgs e)
        {
            CloseV2ray();

            this.Visible = false;
            this.Close();

            statistics.Close();

            //this.Dispose();
            //System.Environment.Exit(System.Environment.ExitCode);
            Application.Exit();
        }
Ejemplo n.º 3
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.º 4
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 { }
        }