关于Dictionary元素的遍历
生活随笔
收集整理的這篇文章主要介紹了
关于Dictionary元素的遍历
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
如何在C#中遍歷Hashtable中的元素,每次遍歷時,需要得到Key和Value
IDictionary?dictionary?=?new?Hashtable();
foreach?(DictionaryEntry?entry?in?dictionary)
{
????Object?key?=?entry.Key;
????Object?val?=?entry.Value;
}
IDictionary?dictionary?=?new?Hashtable();
foreach?(DictionaryEntry?entry?in?dictionary)
{
????Object?key?=?entry.Key;
????Object?val?=?entry.Value;
}
轉載于:https://www.cnblogs.com/footleg/archive/2008/04/16/1155873.html
總結
以上是生活随笔為你收集整理的关于Dictionary元素的遍历的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 通常你会在什么地方遇到DBNull?
- 下一篇: 给FlvDownloader加了一个视频