.NET provides a basic configuration management class, but it's not as flexible or easy to use as it could be. Find out how you can create a more flexible interface that provides strong typing, encryption, and write access to your application settings.
by Rick Strahl
August 6, 2004
onfiguration settings make it possible for users and administrators to configure an application before it is run for the first time and while it runs. .NET provides a good rudimentary mechanism for storing and retrieving configuration settings in the application's .config file with the ConfigurationSettings class, but this mechanism is missing a number of essential features. This article describes how to improve on the base functionality using a class that provides strong typing, allows for writing of keys, and provides optional encryption of keys.
I consider configuration information a vital component of any application and use it extensively for allowing customization of the application both at runtime and through external configuration settings. I try to make as many options user-configurable as possible and configure everything from user interface elements, to top level business logic options, all the way to developer options that allow me to do things like switch in and out of detailed debug modes, turn on logging or tracing, and so on. A Configuration class is not exactly a sexy feature, but it's quite vital to the usability and configurability of an application.
It's quick, easy and you get access to all the articles on DevX.
This registration/login is to allow you to read articles on devx.com. Already a member?
To become a member of DevX.com create your Member Profile by completing the form below. Membership is free!