方法一
 foreach (System.Collections.DictionaryEntry de in objHasTab)
{
    //注意HastTable内存储的默认类型是object,需要进行转换才可以输出
    Console.WriteLine(de.Key.ToString());
    Console.WriteLine(de.Value.ToString());
}

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

 

相关文章:

  • 2022-12-23
  • 2021-11-21
  • 2021-11-09
  • 2021-07-19
  • 2022-12-23
  • 2022-12-23
  • 2021-08-06
  • 2021-11-30
猜你喜欢
  • 2022-01-21
  • 2021-09-30
  • 2022-12-23
  • 2022-12-23
  • 2021-11-01
  • 2021-09-11
  • 2021-12-19
相关资源
相似解决方案