Working with the Registry
My.Computer.Registry provides methods and properties that can be used to get and set values in registry keys. To use these properties, you must have Read and Write permission from the RegistryPermissionAccess Enumeration. Any code running with full trust (under the default security policy, this is any code installed on the user's local hard drive) has the necessary permissions to access the registry.
To Set a Registry Value
- Create a Windows application.
- Add code to set the value, specifying key and value, as in the following code.
"MyTestKeyValue","This is a test value.")
- Open the registry to verify that the specified value was set.
To Get a Registry Value
- Using the previous example, add code to read the value, specifying the path and the name. This code reads the value Name from the key HKEY_CURRENT_USER\Software\MyApp.
readValue = My.Computer.Registry.GetValue _
("HKEY_CURRENT_USER\Software\MyApp", "Name", Nothing)
For more of such intresting stuff check