I'm creating a registry key like this:
Key = Registry.CurrentUser.CreateSubKey("Mykey");
Then open it when my application runs the second time:
Key = Registry.CurrentUser.OpenSubKey("Mykey");
But I got an access denied when trying to create its subkey:
Subkey = Key.CreateSubKey("Mysubkey"); <-- Runtime error here
Any suggestion why? I guess it's because I didn't set the permissions on 'Mykey' at the time it is created. But I just don't know how to set these permissions.