I am trying to write a small windows application that you enter a domain\username and a key and hit enter. When you do this, the program will retrieve the password (which was encrypted, but through the program it spits it out to the user unencrypted). This encrypted password is stored in the registry.
When I created it, I was an admin on the server where the registry was/is stored. But what I found out later, is that when regular non-admin users try to use the application, they get this exception:
System.ArgumentException ---> System.Security.SecurityException: Requested registry access is not allowed.
Here's a couple lines of the code where it chokes (chokes on second line)
Expand|Select|Wrap|Line Numbers
- // connect to remote LocalMachine RegistryHive
- RegistryKey remoteLocalMachineRegKey = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, repositoryServer);
- // open remote respository registry key
- RegistryKey remoteRepositoryRegKey = remoteLocalMachineRegKey.OpenSubKey(regPath, RegistryKeyPermissionCheck.ReadWriteSubTree, RegistryRights.FullControl);
Can anyone help me out here and maybe point me to what I am doing wrong?
Thanks so much....