ConfigurationSectionCollection.GetKey(Int32) Methode

Definitie

Hiermee haalt u de sleutel op van het opgegeven ConfigurationSection object dat in dit ConfigurationSectionCollection object is opgenomen.

public:
 System::String ^ GetKey(int index);
public string GetKey(int index);
member this.GetKey : int -> string
Public Function GetKey (index As Integer) As String

Parameters

index
Int32

De index van het object waarvan de ConfigurationSection sleutel moet worden geretourneerd.

Retouren

De sleutel van het ConfigurationSection object op de opgegeven index.

Voorbeelden

In het volgende codevoorbeeld ziet u hoe u deze kunt gebruiken GetKey.

int i = 0;
while (secEnum.MoveNext())
{
    string setionName = sections.GetKey(i);
    Console.WriteLine(
        "Section name: {0}", setionName);
    i += 1;
}
Dim i As Integer = 0
While secEnum.MoveNext()
    Dim setionName _
    As String = sections.GetKey(i)
    Console.WriteLine( _
    "Section name: {0}", setionName)
    i += 1
End While

Van toepassing op

Zie ook