日期:2014-05-18 浏览次数:20416 次
<configSections> <section name="customProvider" type="DatabaseProvider.HiSection,DatabaseProvider"/> </sectionGroup> </configSections> <customProvider defaultProvider="SqlHiProvider"> <providers> <add name="SqlHiProvider" type="DataBaseProvider.SqlArticleProvider,DatabaseProvider"></add> </providers> </customProvider>
namespace DatabaseProvider { public class HiSection : ConfigurationSection { /// <summary> /// A collection of registered providers. /// </summary> [ConfigurationProperty("providers")] public ProviderSettingsCollection Providers { get { return (ProviderSettingsCollection)base["providers"]; } } [StringValidator(MinLength = 1)] [ConfigurationProperty("defaultProvider", DefaultValue = "SqlHiProvider")] public string DefaultProvider { get { return (string)base["defaultProvider"]; } set { base["defaultProvider"] = value; } } } }