1

There are a lot of questions out there but most answers are old and use deprecated methods.

I would like to know the following:

  • How do I get/set proxy settings configured in IE? I presume this is what is referred to as system-wide.
  • How do I set proxy settings for a specific request using the WebClient, not the WebRequest/WebResponse objects?

I am only looking for a completely managed solution unless one does not exist.

Raheel Khan
  • 14,205
  • 13
  • 80
  • 168

1 Answers1

0

Use Proxy property from WebRequest or HttpWebRequest class.

http://msdn.microsoft.com/en-us/library/system.net.webrequest.proxy.aspx

http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.proxy.aspx

By last link, citation:

...If the Proxy property is specified, then the proxy settings from the Proxy property override the local computer or application config file and the HttpWebRequest instance will use the proxy settings specified. If no proxy is specified in a config file and the Proxy property is unspecified, the HttpWebRequest class uses the proxy settings inherited from Internet Explorer on the local computer. If there are no proxy settings in Internet Explorer, the request is sent directly to the server...

Regfor
  • 8,515
  • 1
  • 38
  • 51
  • That sounds pretty definitive. I also tried the same thing with the WebClient wrapper and it seems to work like a charm. Thanks. – Raheel Khan May 06 '12 at 01:12