12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- /*******************************************************************************
- * iNethinkCMS - 网站内容管理系统
- * Copyright (C) 2012-2013 inethink.com
- *
- * @author jackyang <69991000@qq.com>
- * @website http://cms.inethink.com
- * @version 1.3.6.0 (2013-08-14)
- *
- * This is licensed under the GNU LGPL, version 3.0 or later.
- * For details, see: http://www.gnu.org/licenses/gpl-3.0.html
- *******************************************************************************/
- using System;
- using System.Web;
- namespace iNethinkCMS.Command
- {
- public class Command_DataCache
- {
- /// <summary>
- /// 获取当前应用程序指定CacheKey的Cache值
- /// </summary>
- /// <param name="CacheKey"></param>
- /// <returns></returns>
- public static object GetCache(string CacheKey)
- {
- System.Web.Caching.Cache objCache = HttpRuntime.Cache;
- return objCache[CacheKey];
- }
- /// <summary>
- /// 设置当前应用程序指定CacheKey的Cache值
- /// </summary>
- /// <param name="CacheKey"></param>
- /// <param name="objObject"></param>
- public static void SetCache(string CacheKey, object objObject)
- {
- System.Web.Caching.Cache objCache = HttpRuntime.Cache;
- objCache.Insert(CacheKey, objObject);
- }
- /// <summary>
- /// 设置当前应用程序指定CacheKey的Cache值
- /// </summary>
- /// <param name="CacheKey"></param>
- /// <param name="objObject"></param>
- 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);
- }
- }
- }
|