I would like to open a registry key, then enumerate through all its values. Need to get the value name as well as the value data. Probably an easy one....
Thanks in advance!
Printable View
I would like to open a registry key, then enumerate through all its values. Need to get the value name as well as the value data. Probably an easy one....
Thanks in advance!
I don't use VB.Net, but in VB6 you would use the RegEnumKeyEx API call, i'm sure you can find an example for .net ;)
Example (requires an Imports Microsoft.Win32):
Returns quite a few rows here, but I think you see the point.Code:Dim regClsID As RegistryKey = Registry.ClassesRoot.OpenSubKey("CLSID")
Dim clsid As String
For Each clsid In regClsID.GetSubKeyNames
Dim regClsIDKey As RegistryKey = regClsID.OpenSubKey(clsid)
MsgBox(clsid.ToString & ", " & CStr(regClsIDKey.GetValue("")))
Next