NameValueConfigurationCollection.Item Property (String)

 

Gets or sets the NameValueConfigurationElement object based on the supplied parameter.

Namespace:   System.Configuration
Assembly:  System.Configuration (in System.Configuration.dll)

public NameValueConfigurationElement this[
	string name
] { get; set; }

Parameters

name
Type: System.String

The name of the NameValueConfigurationElement contained in the collection.

Use the Item property to get or set a NameValueConfigurationElement object based on the name parameter.

The following code example demonstrates how to use the Item property. This code example is part of a larger example provided for the NameValueConfigurationCollection class.

// Item property.
Console.WriteLine("Value of property 'enabled': {0}",
 myNameValConfigCollection["enabled"].Value);

.NET Framework
Available since 2.0
Return to top
Show: