Mega Code Archive

 
Categories / C# / Collections Data Structure
 

Get IDictionaryEnumerator enumerator from Hashtable

using System; using System.Collections; public class Starter {     public static void Main() {         Hashtable zHash = new Hashtable();         zHash.Add("one", 1);         zHash.Add("two", 2);         zHash.Add("three", 3);         zHash.Add("four", 4);         IDictionaryEnumerator e = zHash.GetEnumerator();         while (e.MoveNext()) {             Console.WriteLine(                 "{0} {1}",                 e.Key, e.Value);         }     } }