摘要:
第一种:.Net 3.5 代码:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 闭包{ class Program { static void Main(string[] args) { ListAction arr = new ListAction(); for (int i = 0; i 3; i++) { arr.Add(()={Console.WriteLine(i);}); } foreach (var item in arr) { 阅读全文