设为首页
加入收藏
站内地图
旧版入口
当前位置:首页 > 站长学院 > 网络编程 > ASP

几个开源项目配置信息的存储和处理的方式

作者:佚名 出处:网络转载 时间:09-22 点击:

内容载入中...
最近在看duwamish7,asp.net forums, dottext几个优秀的开源(微软官方)的项目
因我目前所处的技术水平的阶段的原因,我看这些项目程序,更加关注的是具体的实现
次之才是架构

比较第一篇:
几个开源项目实体层实现方式比较

这次的关注点是它们存储和处理配置信息的不同方式

一,duwamish7和asp.net forums
这两者处理方式有相同之处,都是通过实现IConfigurationSectionHandler来实现配置类
配置类的代码如下:

    public class DuwamishConfiguration : IConfigurationSectionHandler
    
{
        private static string
 dbConnectionString  ;
        private static bool
 enablePageCache ;

        IConfigurationSectionHandler 成员
#region IConfigurationSectionHandler 成员

        
public object Create(object parent, object configContext, System.Xml.XmlNode section)
        
{
            NameValueCollection settings ;
            try

            {
                NameValueSectionHandler baseHandler = new
 NameValueSectionHandler() ;
document.getElementById('loading').style.display="none";
收藏本文:
】【打印页面】【推荐给朋友】【关闭窗口