标签:
Dictionary<int, string> dc = new Dictionary<int, string>(); dc.Add(1, "看了"); dc.Add(2, "没看"); dc.Add(3, "不知道"); dc[1] = "哈哈"; foreach (KeyValuePair<int,string> item in dc) { Console.WriteLine("{0}---{1}", item.Key, item.Value); } //foreach (var item in dc.Keys) //{ // Console.WriteLine("{0}---{1}", item, dc[item]); //} Console.ReadKey();
标签:
原文地址:http://www.cnblogs.com/zywf/p/4510699.html