Click or drag to resize
ArrayCreateInstance Method (Type, Int32, Int32)
Creates a multidimensional Array of the specified Type and dimension lengths, with the specified lower bounds.

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

Parameters

elementType
Type: SystemType
The Type of the Array to create.
lengths
Type: SystemInt32
A one-dimensional array that contains the size of each dimension of the Array to create.
lowerBounds
Type: SystemInt32
A one-dimensional array that contains the lower bound (starting index) of each dimension of the Array to create.

Return Value

Type: Array
A new multidimensional Array of the specified Type with the specified length and lower bound for each dimension.
Exceptions
ExceptionCondition
ArgumentNullExceptionelementType is null.-or-lengths is null.-or-lowerBounds is null.
ArgumentExceptionelementType is not a valid Type.-or-The lengths array contains less than one element.-or-The lengths and lowerBounds arrays do not contain the same number of elements.
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-Any value in lowerBounds is very large, such that the sum of a dimension's lower bound and length is greater than MaxValue.
See Also