摘要: 当用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... 阅读全文
posted @ 2013-08-01 13:09 iDEAAM 阅读(9553) 评论(0) 推荐(0) 编辑