Skip to Content
.NET Common Language Runtime Unleashed
book

.NET Common Language Runtime Unleashed

by Kevin Burton
April 2002
Intermediate to advanced content levelIntermediate to advanced
1024 pages
23h 26m
English
Sams
Content preview from .NET Common Language Runtime Unleashed

System.Configuration

System.Configuration is a namespace that contains classes for reading and manipulating configuration files. Listing B.48 (configuration.exe.config) shows a sample configuration file.

Listing B.48. Application Configuration File
<configuration>
    <appSettings>
        <add key="Application Name" value="MyApplication" />
        <add key="Application Size" value="10X10" />
        <add key="Application Position" value="Middle" />
        <add key="Application Duration" value="Infinite" />
    </appSettings>
</configuration>

The code in Listing B.49 retrieves the configuration settings (configuration.cs) from the configuration file in Listing B.48.

Listing B.49. Reading an Application Configuration File
 public class ConfigurationMain { static void Main(string ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Customizing the Microsoft® .NET Framework Common Language Runtime

Customizing the Microsoft® .NET Framework Common Language Runtime

Steven Pratschner

Publisher Resources

ISBN: 0672321246Purchase book