摘要:
当用foreach遍历Collection时,如果对Collection有Add或者Remove操作时,会发生以下运行时错误:"Collection was modified; enumeration operation may not execute." 如下所示: [c-sharp] view plaincopy List list = new List(); for (int i = 0; i keys = new List(); foreach (DictionaryEntry de in ht) { /* ope... 阅读全文