Share via


KeyValueConfigurationElement.Value 屬性

定義

取得或設定 KeyValueConfigurationElement 物件的值。

public:
 property System::String ^ Value { System::String ^ get(); void set(System::String ^ value); };
[System.Configuration.ConfigurationProperty("value", DefaultValue="")]
public string Value { get; set; }
public string Value { get; set; }
[<System.Configuration.ConfigurationProperty("value", DefaultValue="")>]
member this.Value : string with get, set
member this.Value : string with get, set
Public Property Value As String

屬性值

KeyValueConfigurationElement 的值。

屬性

範例

下列程式代碼範例示範如何使用 Value 屬性。 此程式代碼範例是類別概觀所提供較大範例的 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

適用於