/// <summary> /// 加入当前对象到缓存中 /// </summary> /// <param name="objId">对象的键值</param> /// <param name="o">缓存的对象</param> public virtual void AddObjectWith(string objId, object o) { if (objId == null || objId.Length == 0 || o == null) { return; } CacheItemRemovedCallback callBack = new CacheItemRemovedCallback(onRemove); webCache.Insert(objId, o, null, System.DateTime.Now.AddSeconds(TimeOut), Cache.NoSlidingExpiration, CacheItemPriority.High, callBack); }