VB:
Dim YourArray() As Integer
...
ReDim Preserve YourArray(i)
C#:
int[] YourArray;
...
int[] temp = new int[i + 1];
if (YourArray != null)
Array.Copy(YourArray, temp, Math.Min(YourArray.Length, temp.Length));
YourArray = temp;
全站熱搜
VB:
Dim YourArray() As Integer
...
ReDim Preserve YourArray(i)
C#:
int[] YourArray;
...
int[] temp = new int[i + 1];
if (YourArray != null)
Array.Copy(YourArray, temp, Math.Min(YourArray.Length, temp.Length));
YourArray = temp;