private void UpdateProxy() { RequestSettings settings = RequestSettings.getInstance(); GConf.Client client = new GConf.Client(); try { bool use = (bool)client.Get("/system/http_proxy/use_http_proxy"); if (!use) { return; } string host = (string)client.Get("/system/http_proxy/host"); if (host == null) { return; } int port = (int)client.Get("/system/http_proxy/port"); if (port <= 0) { return; } Console.WriteLine("Proxy " + host + ":" + port); settings.Proxy = new WebProxy(host, port); } catch (Exception e) {} }
private void UpdateProxy() { RequestSettings settings = RequestSettings.getInstance(); settings.Proxy = new WebProxy(this.proxyhost, this.proxyport); //settings }
private void UpdateCredentials() { if ((this.username != null) && (this.password != null)) { RequestSettings settings = RequestSettings.getInstance(); settings.Credentials = new NetworkCredential(this.username, this.password); } }