public OpenSubKey ( string name ) : Microsoft.Win32.RegistryKey | ||
name | string | |
return | Microsoft.Win32.RegistryKey |
using Microsoft.Win32; RegistryKey key = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft");
using Microsoft.Win32; RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion", true); key.SetValue("SomeValue", "Hello World");In this example, we are opening the subkey "CurrentVersion" under the "Windows" key in the local machine's registry. The boolean value "true" passed as the second parameter indicates that we want write access to the key. We then set a new value "Hello World" to the "SomeValue" registry value within the key. Package library: Microsoft.Win32.Registry.
public OpenSubKey ( string name ) : Microsoft.Win32.RegistryKey | ||
name | string | |
return | Microsoft.Win32.RegistryKey |