|
√ Google adsense申请技巧 √ 本站核心代理域名注册主机业务
√ 快速发布你的买卖域名买卖网站信息
√ 1元注册 cn域名
√ 站长每日新闻导读 √ ·推荐万网空间¥120元 150m √ 站长网:站长必上的网站 √ 网站联盟大全 √ 本站代理万网域名55空间120元 |
| public class DataProvider { public static IDataProvider Instance() { //use the cache because the reflection used later is expensive Cache cache = System.Web.HttpContext.Current.Cache; if ( cache["IDataProvider"] == null ) (NameValueCollection)ConfigurationSettings.GetConfig("appSettings"); String assemblyPath = context[prefix + "DataProviderAssemblyPath"]; "DataProviderClassName"]; // assemblyPath presented in virtual form, must convert to physical path HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath + "/bin/" + assemblyPath); // Uuse reflection to store the constructor of the class that implements IWebForumDataProvider assemblyPath).GetType( className ).GetConstructor(new Type[0]), new CacheDependency( assemblyPath ) ); // could not locate DLL file Could not locate file: <code>" + assemblyPath + "</code> or could not locate class <code>" + className + "</code> in file."); ((ConstructorInfo)cache["IDataProvider"]).Invoke(null) ); |