==========================================================yield关健字var q = GetNums(5); public static IEnumerable GetNums(int nums) { int result = 0; for (int i = 0; i < nums; i++) { result = i; yield return result; } }结果输出0,1,2,3,4五个数msdnyield keyword signals to the compiler that the method in whi Read More
posted @ 2012-06-08 11:34 咸鱼公子 Views(219) Comments(0) Diggs(0) Edit