Udostępnij za pośrednictwem


<add> Element for NameValueSectionHandler and DictionarySectionHandler

Adds custom application settings. Each <add> tag contains a key/value pair.

<configuration>
**      <section name>**
**         <add>**

<add
   key="key"
   value="value"/>

Required Attributes

Attribute Description
key Specifies the name of the setting.
value Specifies the value of the setting.

Example

The following example shows how to define a custom configuration section and use the <add> element to put settings in the section.

<configuration>
   <configSections>
      <section name="dictionarySample"
         type="System.Configuration.DictionarySectionHandler,System"/>
   </configSections>
   <dictionarySample>
      <add key="myKey" value="myValue"/>
   </dictionarySample>
</configuration>

Configuration File

This element can be used in the application configuration file, machine configuration file (Machine.config), and Web.config files that are not at the application directory level.

See Also

Configuration Sections Schema | Configuration Section Settings | Custom Element for NameValueSectionHandler and DictionarySectionHandler