Array.GetLongLength(Int32) Array.GetLongLength(Int32) Array.GetLongLength(Int32) Array.GetLongLength(Int32) Method

定義

取得代表 Array 指定維度之元素數目的 64 位元整數。Gets a 64-bit integer that represents the number of elements in the specified dimension of the Array.

public:
 long GetLongLength(int dimension);
[System.Runtime.InteropServices.ComVisible(false)]
public long GetLongLength (int dimension);
member this.GetLongLength : int -> int64
Public Function GetLongLength (dimension As Integer) As Long

參數

dimension
Int32 Int32 Int32 Int32

需要決定長度之 Array 的以零為起始的維度。A zero-based dimension of the Array whose length needs to be determined.

傳回

64 位元的整數,代表指定維度的元素數目。A 64-bit integer that represents the number of elements in the specified dimension.

例外狀況

dimension 小於零。dimension is less than zero.

-或--or- dimension 等於或大於 Rankdimension is equal to or greater than Rank.

備註

舉例GetLongLengthGetLongLength(0),它會傳回的項目數的第一個維度中ArrayAn example of GetLongLength is GetLongLength(0), which returns the number of elements in the first dimension of the Array.

這個方法是 o (1) 作業。This method is an O(1) operation.

適用於

另請參閱