I'm trying to run a modified version of the example in this Microsoft
article:
http://msdn.microsoft.com/library/de...sekeytopic.asp
The only changes I've made to the code is that instead of using
"HKEY_CURRENT_U SER\Environment " as my registry path I'm using
"HKEY_LOCAL_MAC HINE\Software\P olicies\Microso ft\Windows" and setting
OpenRemoteBaseK ey to open RegistryHive.Lo calMachine instead of the
CurrentUser.
The problem is that I keep getting a SecurityExcepti on. I've tried inserting
the code below inside the try block but with no apparent effect
// *************** *************
SecurityPermiss ion sp =
new SecurityPermiss ion(SecurityPer missionFlag.Unm anagedCode);
sp.Demand();
// *************** *************
Anybody got a clue what's wrong and what I can do to fix it?