https://msdn.microsoft.com/en-us/library/2tw134k3.aspx
You can extend ASP.NET configuration settings with XML configuration elements of your own.
To do this, you create a custom configuration section handler.
The handler must be a .NET Framework class that inherits from the System.Configuration.ConfigurationSection class.
The section handler interprets解释 and processes the settings that are defined in XML configuration elements in a specific section of a Web.config file.
You can read and write these settings through the handler‘s properties.
Create a public class that inherits from the System.Configuration.ConfigurationSection class.
Add code to define the section‘s attributes and elements.
The following example shows how to create a handler for a custom configuration section named "PageAppearance." The section has a RemoteOnly attribute and Font and Color elements. The code shows how to use string, integer, and Boolean attributes. It also shows how to use string and integer validators验证器 for those attributes. (The Boolean attribute is automatically validated经过验证的.) The validators check the format of the configuration markup at run time and throw exceptions if the values provided for the custom attributes do not meet the specified criteria.
How to: Create Custom Configuration Sections Using ConfigurationSection
原文:http://www.cnblogs.com/chucklu/p/6514091.html