/// <summary->
/// set and enable proxy and port for IE
/// </summary->
public void SetProxy(string proxy, int port)
{
RegistryKey RegKey = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", true);
// if proxy is not set, disable proxy
if (string.IsNullOrEmpty(proxy))
{
RegKey.SetValue("ProxyServer", "");
RegKey.SetValue("ProxyEnable", 0);
}
else
{
// otherwise set proxy
RegKey.SetValue("ProxyServer", proxy + ":" + port.ToString());
RegKey.SetValue("ProxyEnable", 1);
}
}
Weiterführende Links:
Flash and Proxy Support on .NET WebBrowser Controls
MS AIOCF: WebBrowser with proxy