Re: ASP & the Registry

From: Oleg Leikin (anonymous_at_discussions.microsoft.com)
Date: 01/29/04


Date: Thu, 29 Jan 2004 01:06:07 -0800

Thanks Chris, but as I don't really understand how it works.
It seems to be the instrument to modify the permissions for the application running in some specific security context but my efforts have failed.

I just want to be able to create new key and to set/modify its values, but this class seems to deal with already opened keys.

So I've created the key manually and then tried to set some value:
------------------------------------------------------------------------------------------------------------------
string path = Registry.LocalMachine.Name + "\\Software\\Test";
RegistryPermission regPerm = new RegistryPermission(RegistryPermissionAccess.AllAccess, path);
regPerm.SetPathList(RegistryPermissionAccess.AllAccess, path);

RegistryKey myRoot = Registry.LocalMachine.OpenSubKey(Software\\Test);
myRoot.SetValue("Success", ":-)");
------------------------------------------------------------------------------------------------------------------

Please tell me where I'm wrong !

Thanks

Oleg