日期:2014-05-17 浏览次数:20841 次
List<Model.ElectricityMeterInfo> operateModels = new List<DaHuaElectricMeter.Model.ElectricityMeterInfo>(); List<Model.ElectricityMeterInfo> operateTmpModels = new List<DaHuaElectricMeter.Model.ElectricityMeterInfo>(); foreach (Model.ElectricityMeterInfo emi in Command.SystemData.emiModels) { operateModels.Add(emi); operateTmpModels.Add(emi); } foreach (Model.ElectricityMeterInfo e in operateModels) { operateTmpModels.Remove(e); }
List<int> list1 = new List<int>(); List<int> list2 = new List<int>(); for (int i = 0; i < 10; i++) { list1.Add(i); list2.Add(i); } foreach (var item in list1) { list2.Remove(item); } List<object> list3 = new List<object>(); List<object> list4 = new List<object>(); for (int i = 0; i < 10; i++) { object temp = new object(); list3.Add(temp); list4.Add(temp); } foreach (var item in list3) { list4.Remove(item); }