1
1樓 kid83 2007-01-17 12:43:42
private static readonly string path = System.Configuration.ConfigurationSettings.AppSettings[ "DAL "];
/// <summary> /// 創(chuàng)建對象或從緩存獲取 /// </summary> public static object CreateObject(string path,string CacheKey) { object objType = DataCache.GetCache(CacheKey);//從緩存讀取 if (objType == null) { try { objType = Assembly.Load(path).CreateInstance(CacheKey);//反射創(chuàng)建 DataCache.SetCache(CacheKey, objType);// 寫入緩存 } catch {} } return objType; } 在動(dòng)軟.Net代碼自動(dòng)生成器生成的 DALFactory有這個(gè)code,que找不到這個(gè)類。請問大家知道嗎 2樓 kid83 2007-01-17 13:05:10
沒有人知道?
3樓 no79892575 2007-08-14 17:38:30
/// 獲取當(dāng)前應(yīng)用程序指定CacheKey的Cache值
public static object GetCache(string CacheKey) { System.Web.Caching.Cache objCache = HttpRuntime.Cache; return objCache[CacheKey]; } /// 設(shè)置當(dāng)前應(yīng)用程序指定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
該回復(fù)于2008-12-27 13:32:32被版主刪除
|
|