c#简单缓存使用,添加和修改
private void SetCache(string CacheKey, object objObject, DateTime dt) { System.Web.Caching.Cache objCache = HttpRuntime.Cache; objCache.Insert(CacheKey, objObject, null, dt, TimeSpan.Zero, System.Web.Caching.CacheItemPriority.NotRemovable, null); } /// <summary> /// 获取数据缓存 /// </summary> /// <param name="CacheKey">键</param> private object GetCache(string CacheKey) { System.Web.Caching.Cache objCache = HttpRuntime.Cache; return objCache[CacheKey]; }