I understand HttpWebRequest.DefaultWebProxy returns you default port/host in a computer that it is connected to, if such proxy exists.
Expand|Select|Wrap|Line Numbers
- /// <summary>
- /// Returns a WebProxy object based on active ProxyInfo and if Proxy is enabled, returns default system proxy otherwise
- /// </summary>
- public static IWebProxy GetProxySettings()
- {
- if (Program.conf.ProxyEnabled)
- {
- ProxyInfo acc = Program.conf.ProxyActive;
- if (acc != null)
- {
- NetworkCredential cred = new NetworkCredential(acc.UserName, acc.Password);
- return new WebProxy(acc.GetAddress(), true, null, cred);
- }
- else
- {
- return HttpWebRequest.DefaultWebProxy;
- }
- }
- return null;
- }
Thanks in advance,
McoreD