Cache 缓存
2011-04-19 11:05 yuejianjun 阅读(264) 评论(0) 编辑 收藏 举报 /// <summary>
///以key键值,把value赋给Cache[key].如果不主动清空,会一直保存在内存中.
/// </summary>
///<param name="key">Cache键值</param>
///<param name="value">给Cache[key]赋的值</param>
public static void CacheInsert(string key, object value)
{
System.Web.HttpRuntime.Cache.Insert(key, value);
}
/// <summary>
///清除Cache[key]的值
/// </summary>
///<param name="key"></param>
public static void CacheNull(string key)
{
System.Web.HttpRuntime.Cache.Remove(key);
}
/// <summary>
///根据key值,返回Cache[key]的值
/// </summary>
///<param name="key"></param>
public static object CacheValue(string key)
{
return System.Web.HttpRuntime.Cache.Get(key); ;
}