cnforum自定义配置节

webconfig
< sectionGroup name = " forums " >
    
< section name = " forums "  type = " AspNetForums.Configuration.ForumsConfigurationHandler, AspNetForums.Components "   />
  
</ sectionGroup >

< forums >
< forums >
</ forums >
</ forums >

处理程序

namespace  AspNetForums.Configuration 
    
{
        
public class ForumConfiguration 
        

            
public static ForumConfiguration GetConfig() 
            
{
                
return (ForumConfiguration) ConfigurationSettings.GetConfig("forums/forums");
            }

    
            
internal void LoadValuesFromConfigurationXml(XmlNode node) {}
        }




        
internal class ForumsConfigurationHandler : IConfigurationSectionHandler 
        
{
            
public virtual object Create(Object parent, Object context, XmlNode node) 
            
{
                ForumConfiguration config 
= new ForumConfiguration();
                config.LoadValuesFromConfigurationXml(node);
                
return config;
            }


        }

    }

你可能感兴趣的:(for)