다음을 통해 공유


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

적용 대상