在循环List、集合时,可能会由于修改了集合导致在foreach时出现问题。解决办法就是foreach List.ToArray。 转载于:https://www.cnblogs.com/bitwolaiye/archive/2010/06/25/1765176.html