ConfigurationElement.Item[] Property

Definition

Gets or sets a property, attribute, or child element of this ConfigurationElement object.

Overloads

Item[ConfigurationProperty]

Gets or sets a property or attribute of this configuration element.

Item[String]

Gets or sets a property, attribute, or child element of this configuration element.

Remarks

Use this method to get or set the values of a ConfigurationProperty object.

Item[ConfigurationProperty]

Source:
ConfigurationElement.cs
Source:
ConfigurationElement.cs
Source:
ConfigurationElement.cs

Gets or sets a property or attribute of this configuration element.

protected internal object this[System.Configuration.ConfigurationProperty prop] { get; set; }
protected object this[System.Configuration.ConfigurationProperty prop] { get; set; }

Parameters

prop
ConfigurationProperty

The property to access.

Property Value

The specified property, attribute, or child element.

Exceptions

prop is null or does not exist within the element.

prop is read only or locked.

Remarks

Use the Item[] property to get or set the values of a ConfigurationProperty object.

In C#, this property is the indexer for the ConfigurationSectionCollection class.

Applies to

.NET 9 (package-provided) en andere versies
Product Versies
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

Item[String]

Source:
ConfigurationElement.cs
Source:
ConfigurationElement.cs
Source:
ConfigurationElement.cs

Gets or sets a property, attribute, or child element of this configuration element.

protected internal object this[string propertyName] { get; set; }
protected object this[string propertyName] { get; set; }

Parameters

propertyName
String

The name of the ConfigurationProperty to access.

Property Value

The specified property, attribute, or child element.

Exceptions

prop is read-only or locked.

Remarks

Use the Item[] property to get or set the values of a ConfigurationProperty object.

In C#, this property is the indexer for the ConfigurationSectionCollection class.

Applies to

.NET 9 (package-provided) en andere versies
Product Versies
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9