private static void SetProxy(HttpWebRequest webRequest, ProxySettings proxySettings) { webRequest.Proxy = new WebProxy(proxySettings.Url, proxySettings.Port); webRequest.Proxy.Credentials = new NetworkCredential(proxySettings.UserName, proxySettings.Password); }
private void LogSettings(ProxySettings proxySettings) { var sb = new StringBuilder(); sb.Append("\n\nProxySettings\n-----------\n") .Append("Url: ").Append(proxySettings.Url).Append("\n") .Append("Domain: ").Append(proxySettings.Domain).Append("\n") .Append("UserName: "******"\n") .Append("Password: "******"\n") .Append("Port: ").Append(proxySettings.Port).Append("\n"); _logger.Debug(sb.ToString()); }