.net 中 foreach 遍历 Dictionary
Dictionary<int, string> dict = new Dictionary<int, string>();
dict.Add(1, "str1");
dict.Add(2, "str2");
dict.Add(1, "str1");
dict.Add(2, "str2");
dict.Add(3, "str3");
StringCollection sc = new StringCollection();
foreach( KeyValuePair<int,string> key in dict)
{
sc.Add(key.Key.toString() + key.Value.toString());
}

浙公网安备 33010602011771号