ConfigurationSectionCollection.GetKey(Int32) Yöntem

Tanım

Bu ConfigurationSectionCollection nesnede bulunan belirtilen ConfigurationSection nesnenin anahtarını alır.

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

Parametreler

index
Int32

Anahtarı döndürülecek nesnenin ConfigurationSection dizini.

Döndürülenler

Belirtilen dizindeki ConfigurationSection nesnenin anahtarı.

Örnekler

Aşağıdaki kod örneğinde nasıl kullanılacağı GetKeygösterilmektedir.

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

Şunlara uygulanır

Ayrıca bkz.