ICollection.CopyTo Method

ICollection.CopyTo Method

IIS 7.0

Copies the elements of the collection to an array, starting at a particular array index.

Namespace:  Microsoft.Web.Administration
Assembly:  Microsoft.Web.Administration (in Microsoft.Web.Administration.dll)

void ICollection.CopyTo(
	Array array,
	int index


Type: System..::..Array
The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.
Type: System..::..Int32
The zero-based index in array at which copying starts.


ICollection..::..CopyTo(Array, Int32)


array is nullNothingnullptrunita null reference (Nothing in Visual Basic).


index is less than 0.


array is multidimensional.


array does not have zero-based indexing.


index is equal to or greater than the length of array.


The number of elements in the source System.Collections..::..ICollection object is greater than the available space from index to the end of the destination array.

The specified array must be of a type that inherits from the ConfigurationElement class.

This method uses the List<(Of <(<'T>)>)>..::..CopyTo method to copy the elements.

Community Additions

© 2016 Microsoft