Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Registry and IE proxy

0 views
Skip to first unread message

Zürcher See

unread,
Feb 4, 2004, 4:08:21 AM2/4/04
to
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);

Zürcher See

unread,
Feb 4, 2004, 4:47:38 AM2/4/04
to
I found the problem

so is readonly
Microsoft.Win32.RegistryKey regKey
=Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Window
s\CurrentVersion\Internet Settings");

so is read-write
Microsoft.Win32.RegistryKey regKey
=Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Window
s\CurrentVersion\Internet Settings",true);


"Zürcher See" <aqu...@cannabismail.com> schrieb im Newsbeitrag
news:uJ2d$4v6DH...@TK2MSFTNGP10.phx.gbl...

0 new messages