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值
}