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:
WinInetInterop.SetConnectionProxy(“localhost:8888”);
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
WinInetInterop.RestoreSystemProxy();
Let me know if you thought this was useful! 继续阅读