Click or drag to resize
ArrayCopy Method (Array, Array, Int64)
Copies a range of elements from an Array starting at the first element and pastes them into another Array starting at the first element. The length is specified as a 64-bit integer.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public static void Copy(
	Array sourceArray,
	Array destinationArray,
	long length
)

Parameters

sourceArray
Type: SystemArray
The Array that contains the data to copy.
destinationArray
Type: SystemArray
The Array that receives the data.
length
Type: SystemInt64
A 64-bit integer that represents the number of elements to copy. The integer must be between zero and MaxValue, inclusive.
Exceptions
ExceptionCondition
ArgumentNullExceptionsourceArray is null.-or-destinationArray is null.
RankExceptionsourceArray and destinationArray have different ranks.
ArrayTypeMismatchExceptionsourceArray and destinationArray are of incompatible types.
InvalidCastExceptionAt least one element in sourceArray cannot be cast to the type of destinationArray.
ArgumentOutOfRangeExceptionlength is less than 0 or greater than MaxValue.
ArgumentExceptionlength is greater than the number of elements in sourceArray.-or-length is greater than the number of elements in destinationArray.
See Also