62,074
社区成员
发帖
与我相关
我的任务
分享
public void insCache()
{
string connectionString = "testcache";
Cache _cache = null;
_cache = HttpRuntime.Cache;
DateTime dt = System.DateTime.Now;
JYK.Common.Util.LogTxt("缓存开始时间"+dt.Hour+":"+dt.Minute+":"+dt.Second);
dt = dt.AddSeconds(10);
JYK.Common.Util.LogTxt("缓存过期时间"+dt.Hour+":"+dt.Minute+":"+dt.Second);
_cache.Insert("DSN",
connectionString,
null,
dt,
TimeSpan.Zero,//Cache.NoSlidingExpiration, //TimeSpan.Zero
CacheItemPriority.High,
new System.Web.Caching.CacheItemRemovedCallback (this.RemovedCallback)
);
}