Dictionary can not change the value of the iteration

var buffer = new List<string>(showDict.Keys);
foreach (var key in buffer)
{
if (showDict[key] != "")
{
AddMessage(showDict[key]);
showDict[key] = "";
}
}

Guess you like

Origin www.cnblogs.com/mcyushao/p/11671937.html