C# Adding a key to win registry

EFileTahi-A

Well-known member
Joined
Aug 8, 2004
Messages
539
Location
Portugal / Barreiro
Hello, I need to add a key to win registry so that I can retrieve the installed program path.

1 - How do I add a key with the programs path?
2 - When will I add it anyway? During the programs instalation? How?
3 - And how do I read the registration key that includes the path?

This is my first attempt to use the win registry, I total new to this...

Tks for any possible help.
 
You can create, modify and delete registry keys and values using the [msdn]Microsoft.Win32.Registry[/msdn] class.

The path to your application is retrieved as follows:

Code:
Dim applicationPath As String = System.Reflection.Assembly.GetExecutingAssembly().Location

Most programs add keys and values to the registry when they are installed, and also when they are run for the first time. It is up to you to decide which keys and values are persisted and when.
 
Back
Top