c# framework 缓存依赖

 

  缓存依赖关联文本文件

HashSet<string> uset = new HashSet<string>();
//添加缓存依赖
System.Web.Caching.CacheDependency cdy = new System.Web.Caching.CacheDependency(baseUrl + @"Config\BlackList.txt");
//添加缓存项
HttpRuntime.Cache.Insert(
        "BlackList",
        uset,
        cdy,
        DateTime.MaxValue,
        System.Web.Caching.Cache.NoSlidingExpiration
       );

  

posted @ 2019-07-31 16:41  大P_洲  阅读(254)  评论(0编辑  收藏  举报