NameValueConfigurationCollection.Item[String] 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
根據所提供的參數取得或設定物件 NameValueConfigurationElement 。
public:
property System::Configuration::NameValueConfigurationElement ^ default[System::String ^] { System::Configuration::NameValueConfigurationElement ^ get(System::String ^ name); void set(System::String ^ name, System::Configuration::NameValueConfigurationElement ^ value); };
public System.Configuration.NameValueConfigurationElement this[string name] { get; set; }
member this.Item(string) : System.Configuration.NameValueConfigurationElement with get, set
Default Public Property Item(name As String) As NameValueConfigurationElement
參數
- name
- String
收藏中所包含的名稱 NameValueConfigurationElement 。
屬性值
NameValueConfigurationElement 物件。
範例
以下程式碼範例示範如何使用該 Item[] 屬性。 此程式碼範例是本類別更大範例 NameValueConfigurationCollection 的一部分。
// Item property.
Console.WriteLine("Value of property 'enabled': {0}",
myNameValConfigCollection["enabled"].Value);
' Item property.
Console.WriteLine("Value of property 'enabled': {0}", myNameValConfigCollection("enabled").Value)
備註
利用這個Item[]屬性根據參數取得或設定物件NameValueConfigurationElementname。