Beispiel #1
0
        /// <summary>
        /// 得到模板
        /// </summary>
        /// <param name="filePath">模板先对路径</param>
        /// <returns></returns>
        public string GetTemplate(string filePath)
        {
            object obj = CacheAccess.GetFromCache(filePath);

            if (obj != null)
            {
                return(obj as string);
            }
            else
            {
                try
                {
                    string template = FileAccessHelper.ReadTextFile(Utils.GetPhysicalPath(string.Format("~/{0}", filePath)));
                    CacheAccess.SaveToCache(filePath, template);
                    return(template);
                }
                catch
                {
                    return("此模板文件不存在");
                }
            }
        }