App_Code/CustomCache.cs
(完整代码) 658Busing System;
using System.Web.Caching;
namespace MRSOFTASPNET.CommonOperation
{
public class CustomCache
{
Cache cache;
public CustomCache() { }
public CustomCache(System.Web.Caching.Cache cache)
{
this.cache = cache;
}
public void AddValue(string key,object value)
{ ///检测对象是否为空
if(cache == null) return;
if(string.IsNullOrEmpty(key)) return;
///插入数据
cache.Insert(key,value);
}
public object GetValue(string key)
{ ///检测对象是否为空
if(cache == null) return null;
if(string.IsNullOrEmpty(key)) return null;
///获取数据
return cache.Get(key);
}
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。