G
Guest
Getting a string of boolean value into and out of the registry is no problem.
Here's the problem:
Although you can place an object into the registry and retreive it, I need
to place an ArrayList object with 10 string items into the registry and
retreive them later. I tried this:
key.SetValue("lstNSXitems", lstNSX.Items)
where "lstNSXitems" is the name of the subkey, and lstNSX.Items is the
ArrayList with the 10 items. To retreive the ArrayList, I used this:
If key.GetValue("lstNSXitems") Is Nothing Then
Me.lstNS.Items.AddRange(New Object() {"A", "B", "C", "D", _
"E", "F", "G", "H", _
"I", "J"})
Else
Me.lstNSX.Items.AddRange(New Object()
{key.GetValue("lstNSXitems")})
End If
All this does is place "System.Windows.Forms.ListBox+ObjectCollection" into
the ArrayList on the form.
Can anyone tell me where my logic went south? I don't know if I messed up
the beginning, the end or both.
Thanks for any help. I'm really stumped on this one.
Here's the problem:
Although you can place an object into the registry and retreive it, I need
to place an ArrayList object with 10 string items into the registry and
retreive them later. I tried this:
key.SetValue("lstNSXitems", lstNSX.Items)
where "lstNSXitems" is the name of the subkey, and lstNSX.Items is the
ArrayList with the 10 items. To retreive the ArrayList, I used this:
If key.GetValue("lstNSXitems") Is Nothing Then
Me.lstNS.Items.AddRange(New Object() {"A", "B", "C", "D", _
"E", "F", "G", "H", _
"I", "J"})
Else
Me.lstNSX.Items.AddRange(New Object()
{key.GetValue("lstNSXitems")})
End If
All this does is place "System.Windows.Forms.ListBox+ObjectCollection" into
the ArrayList on the form.
Can anyone tell me where my logic went south? I don't know if I messed up
the beginning, the end or both.
Thanks for any help. I'm really stumped on this one.