惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

云风的 BLOG
云风的 BLOG
GbyAI
GbyAI
G
Google Developers Blog
Engineering at Meta
Engineering at Meta
月光博客
月光博客
腾讯CDC
Recent Announcements
Recent Announcements
酷 壳 – CoolShell
酷 壳 – CoolShell
爱范儿
爱范儿
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
SegmentFault 最新的问题
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
阮一峰的网络日志
阮一峰的网络日志
博客园 - 【当耐特】
The GitHub Blog
The GitHub Blog
Last Week in AI
Last Week in AI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
aimingoo的专栏
aimingoo的专栏
Google DeepMind News
Google DeepMind News
Y
Y Combinator Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Martin Fowler
Martin Fowler
A
About on SuperTechFans
博客园 - 叶小钗

博客园 - seyon

监控 SQL Server 的运行状况 [MSDN]Static,迭代器 [转]不用合并模块部署水晶报表 从vs2005升级到vs2008的理由 [水晶报表]打开报表失败 水晶报表检索COM类工厂中CLSID为{11BD5260-15B6-412D-80DB-12BB60B8FE50}的组件时失败解决办法 DB2连接方法 [转]WEB Service 下实现大数据量的传输 RegisterStartupScript和RegisterClientScriptBlock输出位置的区别 - seyon - 博客园 【转】SOA技术综览 【SQL2005 ReportingService特性与应用】笔记 自定义控件学习笔记(5):事件委托列表的使用 【.NET和J2EE使用Web Services的互操作性】笔记 有用的VS技巧 Windows service安装项目 DataView操作后的结果集 自定义水晶报表工具条 【跟我一起学Visual Studio 2005(1):C#语法篇(上)】笔记 【跟我一起学Visual Studio 2005(19):Crystal Report篇之Web报表服务】笔记
Hashtable的遍历
seyon · 2007-10-15 · via 博客园 - seyon

两种方法:
1.DictionaryEntry

foreach( DictionaryEntry de in hashTable) 

 console.WriteLine(
"Key -- {0}; Value --{1}.", de.Key, de.Value); 
}
 

2.IDictionaryEnumerator

Hashtable food = new Hashtable();
IDictionaryEnumerator myEnumerator  
= food.GetEnumerator();
while(myEnumerator.MoveNext())
{
      strfoodlist 
= strfoodlist + "\n\n" + myEnumerator.Key.ToString();
      strfoodlist 
= strfoodlist + ":\t" +myEnumerator.Value.ToString();
}