Click here to Skip to main content
15,917,329 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
While accessing registry from my system....I am getting error like Registry access is not Allowed..........

RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, "").OpenSubKey("SOFTWARE").OpenSubKey("Microsoft").OpenSubKey("Windows").OpenSubKey("CurrentVersion").OpenSubKey("Installer").OpenSubKey("UserData").OpenSubKey("S-1-5-18").OpenSubKey("Products").GetSubKeyNames()

Try to solve my problem
Updated 22-Mar-10 20:27pm

I guess that means you don't have permission from your server to access the registry on this machine on your network.
Share this answer
Such error occurs because the account accessing the registry does not have the correct user rights.

By default, the user token of the ASP.NET worker process is ASPNET (or NetworkService for applications that run on Internet Information Services [IIS]).

You are trying to access remote system registry key. Try impersonation in your web.config file, where the user used has full access on that remote system.
In general, In a workgroup environment, the account your code runs under must exist on all the machines you want to connect to AND all those accounts must have the same password
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900