緩存工具類CacheHelper,工具類cachehelper
代碼:

![]()
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
namespace Common.Utils
{
/// <summary>
/// 緩存
/// </summary>
public static class CacheHelper
{
/// <summary>
/// 獲取緩存
/// </summary>
public static object Get(string cacheKey)
{
return HttpRuntime.Cache[cacheKey];
}
/// <summary>
/// 設置緩存
/// </summary>
public static void Set(string cacheKey, object value)
{
HttpRuntime.Cache.Insert(cacheKey, value);
}
}
}
View Code