I read almost all the documentation I can find, but I have not yet found a simple working example of how to get IE proxy settings by default using DefaultWebProxy() .
This code seems to compile and work, but how can I continue and get the proxy URI as a string?
HttpWebRequest webRequest = (HttpWebRequest)HttpWebRequest.Create("http://www.google.com"); if (WebRequest.DefaultWebProxy != null) { webRequest.Proxy = WebRequest.DefaultWebProxy; }
EDIT:
Since submitting this question, I have found that one or more proxies can be set for different destinations or bypassed (possibly for local places on the intranet). Therefore, you need to specify a URI for GetProxy() . He should know what destination the proxy server is for. If the “Automatically detect settings” is set in the “Internet Options” window, the browser will search for the PAC file in your local domain. The PAC file contains a Javascript function that determines the proxy address for this destination.
source share