Returns atype which provides access to HKEY_CLASSES_ROOT.
' Usage Dim value As Microsoft.Win32.RegistryKey = My.Computer.Registry.ClassesRoot ' Declaration Public ReadOnly Property ClassesRoot As Microsoft.Win32.RegistryKey
The My.Computer.Registry object offers methods and properties for working with registry keys. Seefor more information.
HKEY_CLASSES_ROOT is primarily used to store information about file associations in Windows.
Theclass, which is in the namespace, controls access to registry variables. Registry variables should not be stored in memory locations where code without RegistryPermission can access them. Similarly, when granting permissions, grant only those privileges necessary to get the job done.
Registry permission access values are defined by theenumeration. The following table details its members.
Create, read, and write access to registry variables.
Create access to registry variables.
No access to registry variables.
Read access to registry variables.
Write access to registry variables.
This example gets the names of the subkeys for the ClassesRoot registry key and adds them to ListBox1.
Dim keyList As System.Collections.IEnumerable keyList = My.Computer.Registry.ClassesRoot.GetSubKeyNames() For Each keyName As String In keyList ListBox1.Items.Add(keyName) Next
This example requires that you have a ListBox named ListBox1 in your project.