- array
- The one-dimensional Array that is the destination of the elements copied from Generic ICollection. The Array must have zero-based indexing.
- arrayIndex
- The zero-based index in array at which copying begins.
Visual Basic (Declaration) | |
---|---|
Public Sub CopyTo( _ ByVal array() As T, _ ByVal arrayIndex As Integer _ ) |
Visual Basic (Usage) | Copy Code |
---|---|
|
C# | |
---|---|
public void CopyTo( T[] array, int arrayIndex ) |
C++/CLI | |
---|---|
public: void CopyTo( array<T>^ array, int arrayIndex ) |
Parameters
- array
- The one-dimensional Array that is the destination of the elements copied from Generic ICollection. The Array must have zero-based indexing.
- arrayIndex
- The zero-based index in array at which copying begins.
Exception | Description |
---|---|
ArgumentNullException | array is null. |
ArgumentOutOfRangeException | arrayIndex is less than 0. |
ArgumentException | array is multidimensional. -or- arrayIndex is equal to or greater than the length of array. -or- The number of elements in the source Generic ICollection is greater than the available space from arrayIndex to the end of the destination array. -or- Type T cannot be cast automatically to the type of the destination array. |
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family