Click or drag to resize
ArrayCreateInstance Method (Type, Int64)
Creates a multidimensional Array of the specified Type and dimension lengths, with zero-based indexing. The dimension lengths are specified in an array of 64-bit integers.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public static Array CreateInstance(
	Type elementType,
	params long[] lengths
)

Parameters

elementType
Type: SystemType
The Type of the Array to create.
lengths
Type: SystemInt64
An array of 64-bit integers that represent the size of each dimension of the Array to create. Each integer in the array must be between zero and MaxValue, inclusive.

Return Value

Type: Array
A new multidimensional Array of the specified Type with the specified length for each dimension, using zero-based indexing.
Exceptions
ExceptionCondition
ArgumentNullExceptionelementType is null.-or-lengths is null.
ArgumentExceptionelementType is not a valid Type.-or-The lengths array contains less than one element.
NotSupportedExceptionelementType is not supported. For example, Void is not supported. -or-elementType is an open generic type.
ArgumentOutOfRangeExceptionAny value in lengths is less than zero or greater than MaxValue.
See Also