按下标方式提取Dictionary的值
2015-06-29 20:31
309 查看
Dictionary通过下标获取key和value
Dictionary<int, string> dic = new Dictionary<int, string>();Dictionary<int, string>.Enumerator en = dic.GetEnumerator();
for (int i = 0; i < dic.Count; i++)
{
if (en.MoveNext())
{
int key = en.Current.Key;
string value = en.Current.Value;
}
}
相关文章推荐
- Linux服务器的最大内存和CPU数
- docker网络
- iOS开发学习实例之六---瀑布流
- Android调用相机并将照片存储到sd卡上
- 可视化系列论文【INFUSE: Interactive Feature Selection for Predictive Modeling of High Dimensional Data】
- Ubuntu怎么设置root用户的密码
- CentOS7 桥接网络配置
- linux上nginx安装和使用
- Spring+MyBatis+Velocity+BootStrap实现Android混合App快速高效服务端
- java线程与锁
- Unity3D 编辑器功能之MonoBehaviour属性
- bzoj1492: [NOI2007]货币兑换Cash
- ARM 流水线技术
- 工作一年八个月了
- Java学习笔记2、环境变量配置与初学者常见错误
- 学习笔记_Java_day12_Cookie
- ARM core 介绍
- 远程调用的几种方式
- HTTP 指纹识别v0.1
- 版本控制系统github基本操作