How can I set a proxy for a Webbrowser Control without setting a proxy for IE?
Basically I want my application to use a certain proxy however obviously I don't want to change user's IE proxy settings.
How can I set a proxy for a Webbrowser Control without setting a proxy for IE?
Basically I want my application to use a certain proxy however obviously I don't want to change user's IE proxy settings.
I see some horrible solutions for this out on the web. Most involve setting the proxy for the entire machine and then toggling it back off. Here is a class that will allow you to set it ONLY FOR THE PROCESS that the control is hosted in. You could call it like this:
and then restore it to the default set in IE with this call:
// read the default settings for IE and restore these as the proxy
Let me know if you thought this was useful!
Listing:
http://blogs.msdn.com/b/jpsanders/archive/2011/04/26/how-to-set-the-proxy-for-the-webbrowser-control-in-net.aspx
No, you can not . The WebBrowser control IS IE. It is the IE rendering engine below. Basically IE.exe is someting like a UI around it.
try UrlMkSetSessionOption INTERNET_OPTION_PROXY and UrlMkSetSessionOption INTERNET_OPTION_REFRESH
If your proxy has password authentication, you may need to implement IAuthenticate(Ex) in your WebBrowserSiteBase derived class.
[1] https://social.msdn.microsoft.com/Forums/fr-FR/f4dc3550-f213-41ff-a17d-95c917bed027/webbrowser-control-for-setting-proxy?forum=winforms