A simple code to create a Registry Key in your local machine:
Required Namespace:
using Microsoft.Win32;
And the function:
static void CreateRegistry()
{
try
{
// Save new Registry to HKEY_LOCAL_MACHINE
RegistryKey rk = Registry.LocalMachine ;
// create new Registry subkey
rk = rk.CreateSubKey("Software\\YouRegistrykey");
rk.SetValue("Version", "1.1.0");
rk.SetValue("AppKey", "1234");
MessageBox.Show("New Registry setting created");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message );
}
}
Happy Coding!




