C#遍历HashTable

方法一foreach (System.Collections.DictionaryEntry objDE in objHasTab)
{
    Console.WriteLine(objDE.Key.ToString());
    Console.WriteLine(objDE.Value.ToString());
}
方法二 

System.Collections.IDictionaryEnumerator enumerator = objHashTablet.GetEnumerator();
while (enumerator.MoveNext())
{
    Console.WriteLine(enumerator.Key);         // Hashtable关健字
    Console.WriteLine(enumerator.Value);      // Hashtable值
}

转自:http://www.cnblogs.com/luqingfei/archive/2007/03/20/681546.html
原文地址:https://www.cnblogs.com/johnwonder/p/1665902.html