赞
踩
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Web;
-
-
- namespace Common
- {
- /// <summary>
- /// 数据缓存类
- /// </summary>
- public class DataCache
- {
- /// <summary>
- /// 获取缓存
- /// </summary>
- /// <param name="CacheKey"></param>
- /// <returns></returns>
- public static object GetCache(string CacheKey)
- {
- return HttpRuntime.Cache[CacheKey];
- }
-
-
- /// <summary>
- /// 设置缓存
- /// </summary>
- /// <param name="CacheKey"></param>
- /// <param name="objObject"></param>
- public static void SetCache(string CacheKey, object objObject)
- {
- HttpRuntime.Cache.Insert(CacheKey, objObject);
- }
-
-
- /// <summary>
- /// 设置缓存
- /// </summary>
- /// <param name="CacheKey"></param>
- /// <param name="objObject"></param>
- /// <param name="absoluteExpiration"></param>
- /// <param name="slidingExpiration"></param>
- public static void SetCache(string CacheKey, object objObject, DateTime absoluteExpiration, TimeSpan slidingExpiration)
- {
- HttpRuntime.Cache.Insert(CacheKey, objObject, null, absoluteExpiration, slidingExpiration);
- }
- }
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。