次の方法で共有


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

適用対象