private void ChinaLifeForm_Load(object sender, EventArgs e) { try { //系统初始化,关闭代理 FiddlerUtils.CloseProxy(); Task.Factory.StartNew(() => { UpdateVersion(); }); CloseSameProcess(); MessageBox.Show("请注意!!! 使用代理工具期间,尽量关闭安全软件哦!(如360安全卫士,防火墙等)", "提醒"); this.usernameTxt.Text = Config.UserName; if (String.IsNullOrEmpty(Config.UserName)) { try { String filePath = GetUserCodeFilePath(); if (File.Exists(filePath)) { this.usernameTxt.Text = File.ReadAllText(filePath); } } catch (Exception ex) { } } StartSyncCookieTimer(); StartUpdateVersionTimer(); StartUpdateProcessAndStartSocketConnect(); } catch (Exception ex) { } }
private void closeProxyButton_Click(object sender, EventArgs e) { FiddlerUtils.CloseProxy(); MessageBox.Show("代理已关闭!\r\n\r\n如代理仍未关闭,请手动取消系统代理即可!", "提醒"); CloseUpdateProcess(); System.Environment.Exit(0); }
private void ChinaLifeForm_FormClosing(object sender, FormClosingEventArgs e) { CloseUpdateProcess(); FiddlerUtils.CloseProxy(); }