I want to store some app information in the registry and I'm not sure where should I store it. I want the info to be for all users so I wouldn't use HKEY_CURRENT_USER. Maybe HKEY_LOCAL_MACHINE but then I'm not sure where in there. I don't know what are the standards for this and something like Environment.SpecialFolder
but for registry paths or folders would be a lot safer and more elegant.
Check the Microsoft.Win32.Registry object. There you can find some objects representing common registry paths, such as:
For example, if you want to access HKEY_CURRENT_USER:
Microsoft.Win32.RegistryKey key;
key = Microsoft.Win32.Registry.CurrentUser.CreateSubKey("Names");
key.SetValue("Name", "Isabella");
key.Close();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With