示例#1
0
        /// <summary>
        /// 保存web业务页面
        /// </summary>
        /// <param name="hFile"></param>
        public static string saveWbdlHtmlFile(WHtmlFile hFile)
        {
            if (string.IsNullOrEmpty(hFile.FileName))
            {
                throw new Exception(Lang.NoFileName);
            }

            string fileName = HttpContext.Current.Server.MapPath(hFile.FileName);

            //if (hFile.IsNew)
            //    fileName = getCatchFileFolder() + "\\" + Path.GetFileName(fileName);

            System.IO.File.WriteAllText(fileName, hFile.Data, Encoding.GetEncoding(hFile.Charset));
            //SaveWbdl(hFile.FileName, hFile.Wbdl);

            //   fileName = fileName.Remove(fileName.IndexOf(XSite.SitePhysicalPath), XSite.SitePhysicalPath.Length);
            //   fileName = fileName.Replace('\\', '/');
            //   if (!fileName.StartsWith("/"))
            //       fileName = "/" + fileName;
            return(fileName);
        }
示例#2
0
        /// <summary>
        /// 保存站点html文件
        /// </summary>
        /// <param name="file"></param>
        public static void saveFile(WHtmlFile file)
        {
            string fileName = HttpContext.Current.Server.MapPath(file.FileName);

            System.IO.File.WriteAllText(fileName, file.Data, Encoding.GetEncoding(file.Charset));
        }