Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » .NET Registry & File Input / Output

Post new topic   Reply to topic
View Registry dat a though a listbox.
View previous topic :: View next topic  
Author Message
Jazztech
Newbie


Joined: 28 Oct 2004
Posts: 8

PostPosted: Nov 15th, 2004 02:58 PM    Post subject: View Registry dat a though a listbox. Reply with quote

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
View user's profile Send private message
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: Nov 15th, 2004 03:29 PM    Post subject: Reply with quote

There are some registry modules posted here... You might want to have a look Smile
_________________
No one is completely useless. They can at least be an example of what to avoid.
Back to top
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » .NET Registry & File Input / Output All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic