using Microsoft.Win32; // Open the registry key using (RegistryKey key = Registry.CurrentUser.OpenSubKey("SOFTWARE\\MyApp")) { // Read the value string myValue = (string)key.GetValue("MyValue"); }
using Microsoft.Win32; // Open the registry key using (RegistryKey key = Registry.CurrentUser.CreateSubKey("SOFTWARE\\MyApp")) { // Set the value key.SetValue("MyValue", "Hello, world!"); }
using Microsoft.Win32; // Open the registry key Registry.CurrentUser.DeleteSubKey("SOFTWARE\\MyApp");These examples demonstrate the basic functionality of the IRegistryCore interface, which is to interact with the Windows registry. The package library is Microsoft.Win32.Registry.