Stefan Richter <sp**@spammenot.com> wrote:
I would like to go through a hashtable and take the next value
to save it into an ArrayList.
How to do that in the most easiest way???
I am looking for something like:
For Each Object value In clientsHashTable
dropDownList.Add(value)
End for | NEXT value
Return dropDownList.ToArray
Using For Each with a Hashtable gives you DictionaryEntry references -
you can then look at the Key and Value properties. Here's a sample:
Option Strict On
Imports System
Imports System.Collections
Public Class Test
Public Shared Sub Main()
Dim table As New Hashtable()
table.Add ("Key1", "Value1")
table.Add ("Key2", "Value2")
Dim entry As DictionaryEntry
For Each entry in table
Console.WriteLine ("{0}={1}", entry.Key, entry.Value)
Next
End Sub
End Class
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too