15.4. Read and Write to the Windows Registry
You need to read information from, or write information to, the Windows registry.
Use the methods GetValue and SetValue of the Microsoft.Win32.Registry class.
The GetValue and SetValue methods open a registry key, get or set its value, and close the key each time they are called. This means they are inefficient when used to perform many read or write operations. The GetValue and SetValue methods of the Microsoft.Win32.RegistryKey class, discussed in recipe 15-5, will provide better performance if you need to perform many read or write operations on the registry.
How It Works