Reading a registry key in C#

Thorin Oakenshield picture Thorin Oakenshield · Dec 17, 2010 · Viewed 149.4k times · Source

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:

HKEY_LOCAL_MACHINE\SOFTWARE\MyApplication\[AppPath]

How can I read AppPath using C#?

Answer

SLaks picture SLaks · Dec 17, 2010

You're looking for the cunningly named Registry.GetValue method.