遍历Dictionary


Dictionary<int, string> dic = new Dictionary<int, string>();
dic.Add(1, "睛睛青");
dic[2] = "sb";
foreach (KeyValuePair<int, string> kup in dic)
{
Console.WriteLine("键{0}******值{1}", kup.Key, kup.Value);
}
Console.ReadKey();

posted @ 2016-04-16 13:36  思维乐趣  阅读(367)  评论(0编辑  收藏  举报