共用方式為


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

適用於