ConfigurationSectionGroupCollection.GetKey(Int32) Metod

Definition

Hämtar nyckeln för det angivna ConfigurationSectionGroup objektet som finns i det här ConfigurationSectionGroupCollection objektet.

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

Parametrar

index
Int32

Indexet för den avsnittsgrupp vars nyckel ska returneras.

Returer

Nyckeln för ConfigurationSectionGroup objektet i det angivna indexet.

Exempel

I följande kodexempel visas hur metoden GetKey används.

int i = 0;
while (groupEnum.MoveNext())
{
    string groupName = groups.GetKey(i);
    Console.WriteLine(
        "Group name: {0}", groupName);
    i += 1;
}
Dim i As Integer = 0
While groupEnum.MoveNext()
   Dim groupName As String = groups.GetKey(i)
   Console.WriteLine("Group name: {0}", groupName)
   i += 1
End While

Gäller för

Se även