System.Array.GetValue Method

Gets the value at the specified position in the three-dimensional Array. The indexes are specified as 32-bit integers.

Syntax

public object GetValue (int index1, int index2, int index3)

Parameters

index1
A 32-bit integer that represents the first-dimension index of the Array element to get.
index2
A 32-bit integer that represents the second-dimension index of the Array element to get.
index3
A 32-bit integer that represents the third-dimension index of the Array element to get.

Returns

The value at the specified position in the three-dimensional Array.

Exceptions

TypeReason
ArgumentExceptionThe current instance does not have exactly three dimensions.
IndexOutOfRangeExceptionAt least one ofindex1 or index2 or index3 is outside the range of valid indexes for the corresponding dimension of the current instance.

Remarks

The Array.GetLowerBound(int) and Array.GetUpperBound(int) methods can determine whether any of the indexes is out of bounds.

This method is an O(1) operation.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0