Share via


KeyValueConfigurationElement.Key 속성

정의

KeyValueConfigurationElement 개체의 키를 가져옵니다.

public:
 property System::String ^ Key { System::String ^ get(); };
[System.Configuration.ConfigurationProperty("key", DefaultValue="", Options=System.Configuration.ConfigurationPropertyOptions.IsKey)]
public string Key { get; }
public string Key { get; }
[<System.Configuration.ConfigurationProperty("key", DefaultValue="", Options=System.Configuration.ConfigurationPropertyOptions.IsKey)>]
member this.Key : string
member this.Key : string
Public ReadOnly Property Key As String

속성 값

KeyValueConfigurationElement의 키입니다.

특성

예제

다음 코드 예제를 사용 하는 방법에 설명 합니다 Key 속성입니다. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 KeyValueConfigurationCollection 클래스 개요입니다.

// Display each KeyValueConfigurationElement.
foreach (KeyValueConfigurationElement keyValueElement in settings)
{
  Console.WriteLine("Key: {0}", keyValueElement.Key);
  Console.WriteLine("Value: {0}", keyValueElement.Value);
  Console.WriteLine();
}
' Display each KeyValueConfigurationElement.
Dim keyValueElement As KeyValueConfigurationElement
For Each keyValueElement In settings
  Console.WriteLine("Key: {0}", keyValueElement.Key)
  Console.WriteLine("Value: {0}", keyValueElement.Value)
  Console.WriteLine()
Next

적용 대상