public static RegistryKey WritableRegistryRoot
{
get
{
return Registry.LocalMachine.OpenSubKey(@"SOFTWARE\SubFolder1\SubFolder2", true);
}
}
When I run the application I got this error
BlockquoteAn exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll.
But when I run the application as Administrator it works.
When I Change the LocalMachine to CurrentUser my Code works. I have decided to use LocalMachine so that I can use the save data in the registry even if I change my Authentication Login.
If there is other way to access LocalMachine Registry without running my application as administrator?