This documentation is archived and is not being maintained.

NameValueCollection.GetKey Method

Gets the key at the specified index of the NameValueCollection.

[Visual Basic]
Public Overridable Function GetKey( _
   ByVal index As Integer _
) As String
public virtual string GetKey(
 int index
public: virtual String* GetKey(
 int index
public function GetKey(
   index : int
) : String;


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

Return Value

A String that contains the key at the specified index of the NameValueCollection, if found; otherwise, a null reference (Nothing in Visual Basic).


Exception Type Condition
ArgumentOutOfRangeException index is outside the valid range of indexes for the collection.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

NameValueCollection Class | NameValueCollection Members | System.Collections.Specialized Namespace | AllKeys