By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,894 Members | 1,191 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,894 IT Pros & Developers. It's quick & easy.

Registry and IE proxy

P: n/a
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\Curre ntVersion\Internet
Settings\ProxyEnabled
HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\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);

Nov 15 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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" <aq****@cannabismail.com> schrieb im Newsbeitrag
news:uJ**************@TK2MSFTNGP10.phx.gbl...
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\Curre ntVersion\Internet
Settings\ProxyEnabled
HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\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);

Nov 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.