แก้ไข

แชร์ผ่าน


ConfigurationSectionCollection.GetKey(Int32) Method

Definition

Gets the key of the specified ConfigurationSection object contained in this ConfigurationSectionCollection object.

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

The index of the ConfigurationSection object whose key is to be returned.

Returns

The key of the ConfigurationSection object at the specified index.

Examples

The following code example shows how to use 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

Applies to

See also