views:

108

answers:

1

HI,

How can i change internet explorer security settings by code.
i want to do the steps below but by code:
Tools -> Internet Options -> Security tab -> Custom Level -> and change the logon type to Anonymous logon.

I think that it can be changed from the registry file but i can't found it.

A: 

Microsoft has rather extensive documentation on the registry keys used by the Internet Zones here.

The settings are located under the key HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Zones[Zone Number], where [Zone Number] is one of 0 = My Computer, 1 = Local, 2 = Trusted Sites, 3 = Internet, 4 = Restricted. To make the change you listed above, you would need to set the value 1A00 to 0x00030000. (Sorry I can't help with registry manipulation in C#).

ig0774
Since I can't comment on the question, I'll just add anything that can be found through a simple Google search, i.e., http://www.google.com/search?q=internet+explorer+security+settings+registry is hardly secret information.
ig0774
Hi, thanks for your reply. When i change the 1A00 value to 0x00030000 and i go to tools->internet options... the Anonymous logon is checked but it is not taking effect and the ie display a blank page instead of popping me a message box to fill username and password.
Gaby
Try also changing the 1A00 value under HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Lockdown_Zones\[Zone Number] to 0x00030000.
ig0774
Also, make sure you close all instances of IE after the change.
ig0774
Hi, i'm facing now an other problem.I can't set the initial value back from registry, I try to reset the 1A00 to its initial value than reopening the IE and the new value still tacking effect.
Gaby
Can you provide some more details: What zone are you working in? Are you sure that both changes were under the HKEY_CURRENT_USER key (there's a similar structure under HKEY_LOCAL_MACHINE)? What's the value you are trying to restore to?
ig0774