I am trying to populate a treeview that has one set node "Connections" already with entries out of a registry.
I have a registry key say, "Nodes". Its a string. I have different cities in it seperated by a ";". I am splitting each area with the ";" to get a string and populate the treeview node. This works fine.
I want to be able to access another registry key that has servernames in it seperate with a ";" as well. and to be added to the correct node as a child node of that node. I am getting exception errors when on everything I try. code below works to populate the node of "connections" and will display the correct Cities. How can I do what I need to do within the same below loop to pull the server names from the registry?
I have a registry key say, "Nodes". Its a string. I have different cities in it seperated by a ";". I am splitting each area with the ";" to get a string and populate the treeview node. This works fine.
I want to be able to access another registry key that has servernames in it seperate with a ";" as well. and to be added to the correct node as a child node of that node. I am getting exception errors when on everything I try. code below works to populate the node of "connections" and will display the correct Cities. How can I do what I need to do within the same below loop to pull the server names from the registry?
Code:
Dim regKey As RegistryKey = Registry.CurrentUser.OpenSubKey("Software\multiRDC")
Dim MyNodes, word As String
If Not regKey Is Nothing Then
MyNodes = My.Computer.Registry.GetValue _
("HKEY_CURRENT_USER\Software\multiRDC\Connections", "Nodes", Nothing)
Dim words As String() = MyNodes.Split(New Char() {";"c})
For Each word In words
TreeView1.Nodes("Connections").Nodes.Add(word)
Next
End If