Array.MaxLength 屬性

定義

取得陣列中可包含的元素數目上限。

public:
 static property int MaxLength { int get(); };
public static int MaxLength { get; }
static member MaxLength : int
Public Shared ReadOnly Property MaxLength As Integer

屬性值

任何陣列中允許的最大元素數。

備註

此特性代表執行時限制,即執行時允許在陣列中擁有的最大元素數(非位元組)。 無法保證此長度下的配置一定成功,但所有嘗試分配較大陣列的嘗試都會失敗。

此特性僅適用於單維零界(SZ)陣列。 Length 對於多維陣列,屬性可能回傳比這個性質更大的值。

適用於