Reading and writing to the registry
How to specify your own custom folder in the registry
Use CreateSubKey() to create a specific folder in HKEY_CURRENT_USER/Software
When saving values to the registry, I like to specify my own folder for my settings.
The CreateSubKey() method allows you to set the folder name. Since the subkey can be null, after checking it for null, use the nullable value type (?) to reference the subkey to get and set values.
string AppRegKey = @"Software\Your Company\Your Product Name";
var subKey = Registry.CurrentUser.CreateSubKey(AppRegKey);
var value = subKey?.GetValue("somekey", "") as string;
subKey?.SetValue("somekey", value);
subKey?.Close();
For further information, see the following:
Create a key in the registry