I have that
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim itm As ListViewItem
Dim root As RegistryKey
Dim searchkey As String = TextBox1.Text
Dim matchtype As String = Nothing
Dim str(5) As String
For Each valueName As String In root.GetValueNames
If valueName.Contains(searchkey) Then
matchtype = "Value Name"
str(0) = matchtype
str(1) = root.Name
str(2) = valueName
str(3) = root.GetValue(valueName)
itm = New ListViewItem(str)
ListView1.BeginUpdate()
ListView1.Items.Add(itm)
ListView1.EndUpdate()
Label11.text = Label11.Text = +1
End If
Next
End Sub
But on line: For Each valueName As String In root.GetValueNames, it says: Object reference not set to an instance of an object.
please help

New Topic/Question
Reply



MultiQuote



|