如果我想遍历 Dictionary(Key, Value)... 为什么不能在循环中添加新的键值对?
Dictionary<string, string> persons = new Dictionary<string, string>();
persons.Add("roger", "12");
persons.Add("mary", "13");
foreach (KeyValuePair<string,string> person in persons)
{
Console.WriteLine("Name: " + person.Key + ", Age: " + person.Value);
persons.Add("Xico", "22");
}