62,040
社区成员
发帖
与我相关
我的任务
分享
/// <summary>
/// 设置当前应用程序指定CacheKey的Cache值
/// </summary>
public static void SetCache(string CacheKey, object objObject, DateTime absoluteExpiration,TimeSpan slidingExpiration )
{
System.Web.Caching.Cache objCache = HttpRuntime.Cache;
objCache.Insert(CacheKey, objObject,null,absoluteExpiration,slidingExpiration);
}
/// <summary>
/// 获取当前应用程序指定CacheKey的Cache值
/// </summary>
public static object GetCache(string CacheKey)
{
System.Web.Caching.Cache objCache = HttpRuntime.Cache;
return objCache[CacheKey];
}