当前位置: 代码迷 >> ASP.NET >> 大哥们帮忙看看这段没错的代码解决办法
  详细解决方案

大哥们帮忙看看这段没错的代码解决办法

热度:6797   发布时间:2013-02-26 00:00:00.0
大哥们帮忙看看这段没错的代码
using   System;
using   System.Reflection;
using   System.Collections.Specialized;
using   System.Configuration.Provider;
using   System.Data;
using   System.Web.Caching;
using   System.Web;
using   System.Web.Configuration;
using   System.Configuration;
namespace   Commerce.Providers   {

        public   abstract   class   CatalogProvider   :   System.Configuration.Provider.ProviderBase
        {

                static   CatalogProvider   _instance;

                static   object   padLock;
                public   static   CatalogProvider   Instance   {

                        get   {
                                CatalogProvider   tempInstance;
                                if   (_instance   ==   null)
                                        padLock   =   new   object();
                                lock   (padLock)   {
                                        tempInstance   =   LoadProvider();
                                        _instance   =   tempInstance;
                                }

                                return   _instance;
                        }
                }
                static   CatalogProvider   LoadProvider()   {

                        //   Get   the   names   of   the   providers
                        //   Use   the   cache   because   the   reflection   used   later   is   expensive
                        Cache   cache   =   System.Web.HttpRuntime.Cache;
                        string   cacheKey   =   null;

                        CatalogProvider   _instanceLoader;
                        CatalogProviderConfiguration   config   =   CatalogProviderConfiguration.GetConfig();
                        cacheKey   =   "CatalogProvider:: "   +   config.DefaultProvider;
  相关解决方案