简单一句话: Dictionary 是 由 KeyValuePair结构 组成的集合

The Dictionary<TKey, TValue>.Enumerator.Current property
returns an instance of this type.

The foreach statement of the C# language (for each in C++, For Each in Visual Basic) requires the type of
the elements in the collection. Since each element of a collection based on IDictionary<TKey,
TValue>
 is a key/value pair, the element type is not the type of the key or the type of the value. Instead, the element type is KeyValuePair<TKey,
TValue>. For example:

 
foreach( KeyValuePair<string, string> kvp in myDictionary )
{
Console.WriteLine("Key = {0}, Value = {1}", kvp.Key, kvp.Value);
}

The foreach statement is a wrapper around the enumerator, which allows only reading from, not writing to, the collection.

最新文章

  1. 6 Candy_Leetcode
  2. ROWNUMBER() OVER( PARTITION BY COL1 ORDER BY COL2)用法
  3. 根据职位名,自动生成jd
  4. BackgroundWorker Threads and Supporting Cancel
  5. UML部署图(转载)
  6. YTU 2621: B 继承 圆到圆柱体
  7. python_Opencv_绘图
  8. SQL Server 修改表
  9. hdu4614(线段树+二分)
  10. SQL Server各个版本的区别
  11. 用nrm一键切换npm源
  12. ReactiveSwift源码解析(八) SignalProducer的代码的基本实现
  13. bzoj 4199 [NOI2015]寿司晚宴
  14. cadence布线完成后的补充操作
  15. Chrome如何访问外网
  16. Mysql中的锁机制
  17. c# Tuple新特性
  18. Vivado HLS初识---阅读《vivado design suite tutorial-high-level synthesis》(4)
  19. [ASE][Daily Scrum]11.07-11.09
  20. CLR via C# 读书笔记-26.线程基础

热门文章

  1. linux 文件删除恢复extundelete
  2. 【Python】字典~深入篇
  3. 重读金典------高质量C编程指南(林锐)-------第五章 常量
  4. sql数据分页
  5. 1.1 合用weightSum属性和layout_weight属性
  6. 制作个人开发IDE
  7. 11-利用session校验图片认证码
  8. 关于HDFS NFS3的配置
  9. Two stage U-Boot design
  10. diy文件系统上创建文件的流程