public CreateSubKey ( string subkey ) : Microsoft.Win32.RegistryKey | ||
subkey | string | |
return | Microsoft.Win32.RegistryKey |
using Microsoft.Win32; RegistryKey key = Registry.CurrentUser.CreateSubKey("Software\\MyApp\\Settings");
using Microsoft.Win32; RegistryKey key = Registry.CurrentUser.OpenSubKey("Software\\MyApp\\Settings", true); key.SetValue("FirstOption", "Enabled"); key.SetValue("SecondOption", "Disabled");This code opens the existing key with the path "Software\MyApp\Settings" under the CurrentUser root key, and sets two values: "FirstOption" with the value "Enabled", and "SecondOption" with the value "Disabled". In both examples, we're using the Microsoft.Win32 package library, which is part of the .NET framework.
public CreateSubKey ( string subkey ) : Microsoft.Win32.RegistryKey | ||
subkey | string | |
return | Microsoft.Win32.RegistryKey |