Share via


NameValueConfigurationCollection.Item[String] 屬性

定義

根據提供的參數取得或設定 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[]使用 屬性,根據 name 參數取得或設定 NameValueConfigurationElement 物件。

適用於