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[] 实现为默认属性,该属性提供相同的索引功能。

适用于