Hashtable.GetEnumerator Method returns an IDictionaryEnumerator that iterates through the Hashtable.
Imports System
Imports System.Collections
Public Class HashtableExample
Public Shared Sub Main()
Dim clouds As New Hashtable()
clouds.Add("One", "1")
clouds.Add("Two", "2")
clouds.Add("Three", "3")
Dim denum As IDictionaryEnumerator = clouds.GetEnumerator()
Dim dentry As DictionaryEntry
While denum.MoveNext()
dentry = CType(denum.Current, DictionaryEntry)
Console.WriteLine(" {0,-17}{1}", dentry.Key, dentry.Value)
End While
End Sub
End Class
Related examples in the same category