文章正文

依赖文件的缓存Cache获取文字

加入时间:2016/8/19 18:13:51

   private string getStr()
    {
        string reslut;
        if (Cache.Get("nihao") == null)
        {
            var filepath = Request.MapPath("/1.txt");
            Cache.Insert("nihao", File.ReadAllText(filepath), new CacheDependency(filepath));
        }
        reslut = Cache.Get("nihao").ToString();
        return reslut;
        //return Cache.Get("nihao").ToString();
    }
 

字体大小[ ]

版权所有:有信心——uxinxin 我的个人网站欢迎常来!手机版(新站开启,请多多关照) 豫ICP备12017930号-1
 豫公网安备 41910102000493号