91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 2KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2021-05-09
  • 語言: C#
  • 標簽: C#??Cookie??Sessio??Cache??

資源簡介

可獲取數據緩存、設置數據緩存、移除指定數據緩存、移除全部緩存等基本功能

資源截圖

代碼片段和文件信息

using?System;
using?System.Web;
using?System.Collections;

namespace?DotNet.Utilities
{
????public?class?CacheHelper
????{
????????///?
????????///?獲取數據緩存
????????///?

????????///?
????????public?static?object?GetCache(string?CacheKey)
????????{
????????????System.Web.Caching.Cache?objCache?=?HttpRuntime.Cache;
????????????return?objCache[CacheKey];
????????}

????????///?
????????///?設置數據緩存
????????///?

????????public?static?void?SetCache(string?CacheKey?object?objobject)
????????{
????????????System.Web.Caching.Cache?objCache?=?HttpRuntime.Cache;
????????????objCache.Insert(CacheKey?objobject);
????????}

????????///?
????????///?設置數據緩存
????????///?

????????public?static?void?SetCache(string?CacheKey?object?objobject?TimeSpan?Timeout)
????????{
????????????System.Web.Caching.Cache?objCache?=?HttpRuntime.Cache;
????????????objCache.Insert(CacheKey?objobject?null?DateTime.MaxValue?Timeout?System.Web.Caching.CacheItemPriority.NotRemovable?null);
????????}

????????///?
????????///?設置數據緩存
????????///?

????????public?static?void?SetCache(string?CacheKey?object?objobject?DateTime?absoluteExpiration?TimeSpan?slidingExpiration)
????????{
????????????System.Web.Caching.Cache?objCache?=?HttpRuntime.Cache;
????????????objCache.Insert(CacheKey?objobject?null?absoluteExpiration?slidingExpiration);
????????}

????????///?
????????///?移除指定數據緩存
????????///?

????????public?static?void?RemoveAllCache(string?CacheKey)
????????{
????????????System.Web.Caching.Cache?_cache?=?HttpRuntime.Cache;
????????????_cache.Remove(CacheKey);
????????}

????????///?
????????///?移除全部緩存
????????///?

????????public?static?void?RemoveAllCache()
????????{
????????????System.Web.Caching.Cache?_cache?=?HttpRuntime.Cache;
????????????IDictionaryEnumerator?CacheEnum?=?_cache.GetEnumerator();
????????????while?(CacheEnum.MoveNext())
????????????{
????????????????_cache.Remove(CacheEnum.Key.ToString());
????????????}
????????}
????}
}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件???????2236??2017-09-10?15:02??Cookie&Session&Cache\CacheHelper.cs

?????文件???????2083??2017-09-10?15:02??Cookie&Session&Cache\CookieHelper.cs

?????文件????????980??2017-09-10?15:02??Cookie&Session&Cache\Sessionhelper.cs

?????文件???????3458??2017-09-10?15:02??Cookie&Session&Cache\Sessionhelper2.cs

?????目錄??????????0??2018-07-03?12:21??Cookie&Session&Cache

-----------?---------??----------?-----??----

?????????????????8757????????????????????5


評論

共有 條評論