private void tsbtnCopyPacUrl_Click(object sender, EventArgs e) { var pacurl = SimpleHTTPServer.GetOrStartDefaultServer().PACUrl; notifyIcon1.ShowBalloonTip(3000, string.Empty, pacurl, ToolTipIcon.Info); Clipboard.SetText(pacurl); }
private void tsbtnProxyPAC_Click(object sender, EventArgs e) { var server = SimpleHTTPServer.GetOrStartDefaultServer(); ProxyRoutines.SetAutoConfigURL($"http://127.0.0.1:{server.Port}/{GFWListUpdater.PAC_FILE}"); SaveProxyChanges("P"); }
private void tsbtnExit_Click(object sender, EventArgs e) { KillProcess(); SimpleHTTPServer.GetOrStartDefaultServer().Stop(); allowClose = true; Application.Exit(); }
static void Main() { AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; Application.ThreadException += Application_ThreadException; Task.Factory.StartNew(() => { SimpleHTTPServer.GetOrStartDefaultServer(); }); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm()); }
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { SimpleHTTPServer.GetOrStartDefaultServer().Stop(); MessageBox.Show(e.ExceptionObject?.ToString()); }
private static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e) { SimpleHTTPServer.GetOrStartDefaultServer().Stop(); MessageBox.Show(e.Exception?.ToString()); }