Thorin Oakenshield Thorin Oakenshield - 9 months ago 64
C# Question

Reading a registry key in C#

I have developed an application and installed it on a client computer. In my application I need to get its installation path. My application has a registry entry at:


How can I read
using C#?


see this


You can use RegistryKey class under Microsoft.Win32 namespace.

Some important functions of RegistryKey are as follows:

GetValue       //to get value of a key
SetValue       //to set value to a key
DeleteValue    //to delete value of a key
OpenSubKey     //to read value of a subkey (read-only)
CreateSubKey   //to create new or edit value to a subkey
DeleteSubKey   //to delete a subkey
GetValueKind   //to retrieve the datatype of registry key