PDA

Click to See Complete Forum and Search --> : Registry enumeration - Easy, I think.


VB-Mike
Dec 2nd, 2002, 06:34 AM
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!

si_the_geek
Dec 2nd, 2002, 07:17 AM
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 ;)

Athley
Dec 2nd, 2002, 08:51 AM
Example (requires an Imports Microsoft.Win32):

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

Returns quite a few rows here, but I think you see the point.