System.Collections.Specialized.NameValueCollection.GetKey Method

Gets the key at the specified index of the System.Collections.Specialized.NameValueCollection.

Syntax

public virtual string GetKey (int index)

Parameters

index
The zero-based index of the key to get from the collection.

Returns

A string that contains the key at the specified index of the System.Collections.Specialized.NameValueCollection, if found; otherwise, null.

Exceptions

TypeReason
ArgumentOutOfRangeException index is outside the valid range of indices for the current instance.

Remarks

This method is an O(1) operation.

Requirements

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