Dictionarylist = new Dictionary (); list.Add("d", 1); foreach (var item in list) { Console.WriteLine(item.Key + item.Value); } //KeyValuePair foreach (KeyValuePair kv in list) { Console.WriteLine(kv.Key + kv.Value); } //通过键的集合取 foreach (string key in list.Keys) { Console.WriteLine(key + list[key]); } //直接取值 foreach (int val in list.Values) { Console.WriteLine(val); } //非要采用for的方法也可 List test = new List (list.Keys); for (int i = 0; i < list.Count; i++) { Console.WriteLine(test[i] + list[test[i]]); }