代码改变世界
2008-12-16 16:02
Aggron
阅读(126)
评论()
编辑
收藏
举报
![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
Code
1 Dictionary<int, string> dic = new Dictionary<int, string>();
2 dic.Add( 1, "a" );
3 dic.Add( 2, "b" );
4
5 foreach ( KeyValuePair<int, string> k in dic )
6 {
7 //
8 }
9
10 Hashtable ts = new Hashtable();
11 ts.Add( 1, "a" );
12 ts.Add( 2, "b" );
13
14 foreach ( DictionaryEntry de in ts )
15 {
16 //
17 }