To the Windows registry Batman! I haven't played with this thing in years. I never really understood it very well. "Hierarchical database? All these weird names? Huh? What's going on?!" Seems so simple now.
Editing the registry in the .NET environment is easy. See here.
Finding how to change LAN proxy configuration settings took a little longer to find. Explained here.
Proxy exceptions? See here.
With the app working, all that is left to do is set the script to run every 15mins on the programmers' computers, and we're done.
Code looks like:
var key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections", true); if (key == null) throw new NullReferenceException("Registry SubKey not found."); const string defaultConnectionSettings = "DefaultConnectionSettings"; var defaultConnectionSettingsValue = (byte)key.GetValue(defaultConnectionSettings); defaultConnectionSettingsValue = 1; key.SetValue(defaultConnectionSettings, defaultConnectionSettingsValue, RegistryValueKind.Binary);