System.Collections.Specialized.NameValueCollection.Item Property
Gets the value in the current instance that is associated with the specified index.

Syntax

This is the default property for this class.

public string this [int index] { get; }

Parameters

index
A int that specifies the zero-based index of the entry to locate in the current instance.

Value

A string that contains the comma-separated list of values at the specified index of the current instance.

Exceptions

TypeReason
ArgumentOutOfRangeException index is outside the valid range of indices for the current instance.
NotSupportedExceptionThe property is being set and the current instance is read-only.

Remarks

This property is read-only.

Note:

This property provides the ability to access a specific element in the collection by using the following syntax: myCollection[index].

This property cannot be set. To set the value at a specified index, use Item[GetKey(index)].

Requirements

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