用Cache存储数据
来源:互联网 发布:easymule 软件 编辑:程序博客网 时间:2024/05/01 12:12
public class DataCache
{
static DataCache()
{
_Instance = new DataCache();
}
static DataCache _Instance;
public static DataCache Instance
{
get { return _Instance; }
}
public string Add(object obj)
{
string key = Guid.NewGuid().ToString();
HttpContext.Current.Cache.Add( key, obj, null, DateTime.Now.AddSeconds(60), TimeSpan.Zero, CacheItemPriority.High, null);
return key;
}
public object Get(string key, bool keep)
{
object obj = HttpContext.Current.Cache.Get( key );
if( obj != null && !keep )
{
HttpContext.Current.Cache.Remove( key );
}
return obj;
}
public object Get( string key )
{
return Get( key, false );
}
}
- 用Cache存储数据
- Android数据存储——Cache存储
- 页面相关的数据存储Cache
- 数据存储详解(二)---->File存储:内部存储 -Cache和外部存储-SD卡
- 数据cache
- cache 数据保存到cache
- Cache存储引用类型
- cache与虚拟存储
- Android学习笔记之数据的内部存储方式实习数据的读写、存储到Cache实现读写
- Code Fragment-对于一些数据类中经常使用的使用Cache存储起来。
- javascript数据缓存策略之本地存储 与jquery cache 缓存
- 用SharePreference存储数据
- 用SQLite存储数据
- 用SharedPreferences存储数据
- Android第六讲——数据存储(五种)SharedPreferences、内部存储(缓存cache)、外部存储(Sdcrad)、SQLite数据库、网络存储
- HttpRuntime.Cache缓存数据
- cache 缓存 数据结构设计
- OR1200数据Cache介绍
- Calendar自定义日期控件
- 使用OTL进行数据库编程
- 温度数据采集模块简介
- 内核中的物理内存分配函数kernel api
- zoj 1166 Anagram Checker
- 用Cache存储数据
- 免费经济
- event.x,event.clientX,event.offsetX区别
- 智能温度表(下位机)简介
- load balanced cluster
- 入门着怎样建一个普通的触发器
- 温(湿)度测量系统主机简介
- ids for this class must be manually assigned before calling save():***错误说明
- 闲谈 选择自 fengzi_zhu 的 Blog