1
1楼 kid83 2007-01-17 12:43:42
private static readonly string path = System.Configuration.ConfigurationSettings.AppSettings[ "DAL "];
/// <summary> /// 创建对象或从缓存获取 /// </summary> public static object CreateObject(string path,string CacheKey) { object objType = DataCache.GetCache(CacheKey);//从缓存读取 if (objType == null) { try { objType = Assembly.Load(path).CreateInstance(CacheKey);//反射创建 DataCache.SetCache(CacheKey, objType);// 写入缓存 } catch {} } return objType; } 在动软.Net代码自动生成器生成的 DALFactory有这个code,que找不到这个类。请问大家知道吗 2楼 kid83 2007-01-17 13:05:10
没有人知道?
3楼 no79892575 2007-08-14 17:38:30
/// 获取当前应用程序指定CacheKey的Cache值
public static object GetCache(string CacheKey) { System.Web.Caching.Cache objCache = HttpRuntime.Cache; return objCache[CacheKey]; } /// 设置当前应用程序指定CacheKey的Cache值 public static void SetCache(string CacheKey, object objObject) { System.Web.Caching.Cache objCache = HttpRuntime.Cache; objCache.Insert(CacheKey, objObject); } 4楼 justrelax1 2008-12-20 20:55:07
该回复于2008-12-27 13:32:32被版主删除
|
|
来自: orion360doc > 《缓存》