HashTable 遍历的两种方法

using System.Collections;
 
HashTable thProduct;

IDictionaryEnumerator enumerator = thProduct.GetEnumerator(); 
   
while (enumerator.MoveNext())
   {
    arrKey.Add(
"@"+enumerator.Key.ToString());         // Hashtable关健字
    arrValue.Add(enumerator.Value.ToString());            // Hashtable值
   }

foreach (DictionaryEntry objDE in thProduct)
{
    Console.WriteLine(objDE.Key.ToString());
    Console.WriteLine(objDE.Value.ToString());
}
原文地址:https://www.cnblogs.com/wfwup/p/1451721.html