Click or drag to resize
ArrayListCopyTo Method (Array)
Copies the entire ArrayList to a compatible one-dimensional Array, starting at the beginning of the target array.

Namespace: System.Collections
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public virtual void CopyTo(
	Array array
)

Parameters

array
Type: SystemArray
The one-dimensional Array that is the destination of the elements copied from ArrayList. The Array must have zero-based indexing.
Exceptions
ExceptionCondition
ArgumentNullExceptionarray is null.
ArgumentExceptionarray is multidimensional.-or- The number of elements in the source ArrayList is greater than the number of elements that the destination array can contain.
InvalidCastExceptionThe type of the source ArrayList cannot be cast automatically to the type of the destination array.
See Also