Z
Zürcher See
I'm trying to set a value in the registry in order to configure IE so that
it uses a proxy
I found out that there are two values:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\ProxyEnabled
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\ProxyServer
ProxyEnabled is a switch 0/1
ProxyServer contains the proxy IP or proxy URL
But when I try to write in the registry I have the following error:
Into the registry key cannot be written.
at Microsoft.Win32.RegistryKey.ValidateState(Boolean needWrite)
at Microsoft.Win32.RegistryKey.SetValue(String name, Object value)
Microsoft.Win32.RegistryKey regKey =
Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows
\CurrentVersion\Internet Settings");
regKey.SetValue("ProxyEnabled",1);
regKey.SetValue("ProxyServer",sProxy);
it uses a proxy
I found out that there are two values:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\ProxyEnabled
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\ProxyServer
ProxyEnabled is a switch 0/1
ProxyServer contains the proxy IP or proxy URL
But when I try to write in the registry I have the following error:
Into the registry key cannot be written.
at Microsoft.Win32.RegistryKey.ValidateState(Boolean needWrite)
at Microsoft.Win32.RegistryKey.SetValue(String name, Object value)
Microsoft.Win32.RegistryKey regKey =
Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows
\CurrentVersion\Internet Settings");
regKey.SetValue("ProxyEnabled",1);
regKey.SetValue("ProxyServer",sProxy);