共用方式為


ConfigurationElementCollectionBase<T>.Item[Int32] 屬性

定義

取得位於指定索引處的組態專案。

public:
 property T default[int] { T get(int index); };
public T this[int index] { get; }
member this.Item(int) : 'T
Default Public ReadOnly Property Item(index As Integer) As T

參數

index
Int32

要取得之項目的以零為起始的索引。

屬性值

T

在指定索引上的項目。

例外狀況

index 小於 0。

-或-

index 等於或大於 Count

備註

這個屬性可讓您使用下列語法存取集合中的特定專案: myCollection[index]

C# 語言使用 this 關鍵字定義索引,而不必實作 Item[] 屬性。 Visual Basic 會將 Item[] 實作為預設屬性,這樣會提供相同的索引功能。

適用於