ConfigurationSectionCollection.GetKey(Int32) Метод

Определение

Получает ключ указанного объекта ConfigurationSection, содержащегося в данном объекте ConfigurationSectionCollection.

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

Параметры

index
Int32

Индекс объекта ConfigurationSection, ключ которого возвращается.

Возвращаемое значение

Ключ объекта ConfigurationSection по указанному индексу.

Примеры

В следующем примере кода показано, как использовать 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

Применяется к

См. также раздел