Read a registry value
Windows, until .NET, depended heavily on the registry. Therefore, it was irritating that classic VB's built-in methods for registry access were limited to a single registry locationHKEY_CURRENT_USER\Software\VB and VBA Program Settings\appname\section\key. Of course, you could use the API to read and write other keys, but it was complicated (click here for an example).
In contrast, reading and writing to the registry is extremely simple in VB.NET. For example, the following subroutine creates the subkey HKEY_CURRENT_USER\Software\VBDotNetDemo, sets the subkey's name to "VBDotNetDemo" and its value to the String "VB.NET," and then displays a message box showing the new value.
Private Sub btnWriteRegistry_Click(ByVal sender As _
System.Object, ByVal e As System.EventArgs)
Dim aKey As RegistryKey
aKey = Registry.CurrentUser.CreateSubKey _
MessageBox.Show("The value of the new key " _
& "'HKEY_CURRENT_USER\Software\" & _
"VBDotNetDemo' is: " _
& aKey.GetValue("VBDotNetDemo", _
"Default value"), _
"Key Created Successfully")