Hashtable with foreach

You have to use: DictionaryEntry

[sourcecode lang=“c#“]Hashtable ht = new Hashtable();
ht[„one“] = 1;
ht[„two“] = 2;
ht[„three“] = 3;

foreach(DictionaryEntry data in ht)
{
Debug.WriteLine( data.Key + “ => “ data.Value );
}[/sourcecode]

One thought on “Hashtable with foreach”

Comments are closed.