private void btnClearProxy_Click(object sender, EventArgs e) { this.StartBusy(); ProxySwitcher.SetProxyOff(); this.StopBusy("Successfully cleared proxy settings."); this.RefreshProxyStatus(); }
private void RefreshProxyStatus() { string proxy = ProxySwitcher.GetProxy(); if (proxy.Equals("")) { this.proxyStatusLabel.Text = "No Active Proxy..."; } else { this.proxyStatusLabel.Text = "http://" + proxy; } }
private void btnSetProxy_Click(object sender, EventArgs e) { this.StartBusy(); var SelectedProxy = proxylist[this.proxySelection.SelectedIndex]; if (SelectedProxy.protocol == "http") { ProxySwitcher.SetProxyOn(String.Format("{0}:{1}", SelectedProxy.ip, SelectedProxy.port)); this.StopBusy("Successfully set proxy."); } else { errorProvider.SetError(btnSetProxy, "Only support http proxy for now"); this.StopBusy("Only support http proxy for now"); } this.RefreshProxyStatus(); }