| View previous topic :: View next topic |
| Author |
Message |
Jazztech Newbie
Joined: 28 Oct 2004 Posts: 8
|
Posted: Nov 15th, 2004 02:58 PM Post subject: View Registry dat a though a listbox. |
|
|
I am a newbie, and I know it something terribly simple that I am missing. I am attempting to connect to a key in the Registry and to view that parent keys subkey (s) through a list box. When I run the following code nothing appears in the list box. I feel like a uch an idiot. What is it that I am missing?
Imports System
Imports System.IO
Imports Microsoft.Win32
Imports Microsoft.Win32.Registry
Private Const cnRegKey As String = SYSTEM\CurrentControlSet\Enum\USB"
Private Structure RegData
Public value As String
Public Data As String
Public Overrides Function ToString() As String
Return Me.value
End Function
End Structure
Private Sub ListLoad()
Dim RegKey As RegistryKey = Registry.LocalMachine
Dim KeyValue As Object
Dim strValue As String
Dim StrKey As Integer
Dim rd As RegData
ListItems.BeginUpdate()
ListItems.Items.Clear()
RegKey = RegKey.OpenSubKey(cnRegKey)
KeyValue = RegKey.GetValueNames
strValue = CType(KeyValue, String)
For Each strValue In CType(KeyValue, String)
rd.value = strValue.ToString
rd.Data = CType(RegKey.GetValue(strValue), String)
ListItems.EndUpdate()
Next
ListItems.EndUpdate()
End Sub
End Class
Thank you for the assistance
jazztech |
|
| Back to top |
|
P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: Nov 15th, 2004 03:29 PM Post subject: |
|
|
There are some registry modules posted here... You might want to have a look  _________________ No one is completely useless. They can at least be an example of what to avoid. |
|
| Back to top |
|
|