Hi guys, I have the following code that works in a windows service.
the service monitors the local network and accordingly changes the proxy server settings, the problem is that for some reason the proxy server settings are not updated.
the application runs under the local system account, but the registry does not change:
Does anyone have any ideas?
using (var key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Internet Settings", true))
{
if (key != null)
{
key.SetValue("ProxyEnable", Convert.ToInt32(enable), RegistryValueKind.DWord);
key.Flush();
key.Close();
return;
}
}
source
share