I am writing a program to automatically switch my proxy address based on the network I am connected to.
I have so far got everything to work except the part that I have
You can change proxy settings by using the registry. See the following link:
http://support.microsoft.com/kb/819961
Key path: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings
Values:
"MigrateProxy"=dword:00000001
"ProxyEnable"=dword:00000001
"ProxyHttp1.1"=dword:00000000
"ProxyServer"="http://ProxyServername:80"
"ProxyOverride"=""
A question in SuperUser.com regarding how to disable automatically detect settings in ie proxy configuration. Disable "Automatically detect settings" in IE proxy configuration
A snippet, taken from Internet Explorer Automatic Configuration Script Definition via Registry.
Script 1: This enables the AutoConf Script and defines what it is (exchange the http://xxxx with your script)
Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings] "AutoConfigURL"="http://xxx.xxx.xxx.xxx.xxxx" "ProxyEnable"=dword:00000000
Script 2: This script Disables the AutoConf Script and enables a proxy server with exceptions.
Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings] "ProxyEnable"=dword:00000001 "ProxyOverride"="proxyexceptionname:portnumber;anotherexceptionname:port "ProxyServer"="ftp=MyFTPProxy:Port;http=MYHTTPPROXY:PORT;https=MYHTTPSPROXY:PORT "AutoConfigURL"=""