There is an API for Internet Explorer that should be used to change settings.
Wininet Link:
http://msdn.microsoft.com/en-us/library/aa385483(VS.85).aspx
After you change the proxy server settings, you must call the InternetSetOption function with update flags to force Internet Explorer to read the registry and reconfigure it. If you have already changed the values ββin the registry, you can leave by calling the following function (RefreshInternetExplorerSettings) to trigger an IE update.
[DllImport("wininet.dll", SetLastError = true, CharSet = CharSet.Auto)]
private static extern bool InternetSetOption(
IntPtr hInternet,
SET_OPTIONS option,
IntPtr buffer,
int bufferLength);
public enum SET_OPTIONS
{
INTERNET_OPTION_REFRESH = 37,
INTERNET_OPTION_SETTINGS_CHANGED = 39,
INTERNET_OPTION_PER_CONNECTION_OPTION = 75
};
private static void RefreshInternetExplorerSettings()
{
InternetSetOption(IntPtr.Zero, SET_OPTIONS.INTERNET_OPTION_SETTINGS_CHANGED, IntPtr.Zero, 0);
InternetSetOption(IntPtr.Zero, SET_OPTIONS.INTERNET_OPTION_REFRESH, IntPtr.Zero, 0);
}
source
share