国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學(xué)院 > 開發(fā)設(shè)計 > 正文

CacheHelper.cs

2019-11-14 10:25:14
字體:
供稿:網(wǎng)友
using System;using System.Collections.Generic;using System.Linq;using System.Web;namespace Common    {    public class CacheHelper    {        /// <summary>        /// 設(shè)置緩存永久        /// </summary>        /// <param name="sKey"></param>        /// <param name="sContent"></param>        public static void CacheInsert(string sKey, object oContent)        {            HttpContext.Current.Cache.Insert(sKey, oContent);        }        /// <summary>        /// 設(shè)置緩存到指定時間        /// </summary>        /// <param name="sKey"></param>        /// <param name="oContent"></param>        /// <param name="dt">過期時間</param>        public static void CacheInsert(string sKey, object oContent,DateTime dt)        {            HttpContext.Current.Cache.Insert(sKey, oContent, null, dt, TimeSpan.Zero);        }        /// <summary>        /// 獲取緩存的值        /// </summary>        /// <param name="sKey"></param>        /// <returns>請注意如果沒有找到則為Null</returns>        public static object CacheGet(string sKey)        {           return HttpContext.Current.Cache.Get(sKey);        }        /// <summary>        /// 清除緩存        /// </summary>        /// <param name="sKey"></param>        /// <returns></returns>        public static object CacheRemove(string sKey)        {            return HttpContext.Current.Cache.Remove(sKey);        }    }}
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 扶余县| 灵寿县| 徐水县| 庄河市| 汝城县| 辽源市| 林芝县| 德阳市| 汾西县| 西吉县| 九台市| 漯河市| 翁牛特旗| 定远县| 永兴县| 随州市| 三台县| 大邑县| 宜阳县| 黄梅县| 潞西市| 林州市| 两当县| 鹤庆县| 哈密市| 平和县| 洛南县| 嘉善县| 巴南区| 青州市| 安塞县| 伊宁县| 聂荣县| 宜州市| 陕西省| 宁陵县| 德格县| 安新县| 安徽省| 尉氏县| 汤阴县|