Configuration files also allow the programmer to define settings that can be read from within an application. The System.Configuration namespace contains the classes that provide access to these settings.
The <appSettings> section of a configuration file can be used to define key/value pairs, as shown in the following example:
<configuration> <appSettings> <add key="MyFirstKey" value="MyFirstValue"/> <add key="MySecondKey" value="MySecondValue"/> <add key="MyThirdKey" value="MyThirdValue"/> </appSettings> </configuration>
These key/value pairs are accessible independently or as a collection through the AppSettings property of the System.Configuration.ConfigurationSettings class, as shown in the following example: ...