文件Cache处理

来源:互联网 发布:淘宝店被关可以重开 编辑:程序博客网 时间:2024/04/29 23:01
public XmlDocument XmlDoc        {            get            {                string key="XmlSteup";                if(HttpContext.Current.Cache[key] != null)                    return (XmlDocument)HttpContext.Current.Cache[key];                XmlDocument doc = new XmlDocument();                doc.Load(filePath);                CacheDependency depend = new CacheDependency(filePath);                HttpContext.Current.Cache.Insert(key, doc, depend);                return doc;            }        }


说明:主要的 CacheDependency 这个类作用。

原创粉丝点击