http://zhidao.baidu.com/question/67221876
using System; namespace Text { public class ArrayText { public static void Main(String[] args) { Int32[] intArray = new Int32[1]; intArray[0] = 0; for (int n = 0; n < 5; n++) { Array.Resize<int>(ref intArray, intArray.Length+1); //重置数组的大小 intArray[intArray.Length-1] = n; } foreach (int temp in intArray) { Console.WriteLine(temp); } Console.ReadKey(); } } }