public string GetModText(string Str) { string Content1 = ""; StringBuilder Shtml = new StringBuilder(); //创建一个可变字符字符串 // y.accDAL.help h = new y.accDAL.help(); try { string mytemp = WebConfigurationManager.AppSettings["skin"] + Str; mytemp = System.Web.HttpContext.Current.Server.MapPath(mytemp); using (StreamReader sr = new StreamReader(mytemp)) { String line; while ((line = sr.ReadLine()) != null) { Shtml.Append(line + Environment.NewLine); } sr.Close(); } lntag mycms = new lntag(); Content1 = mycms.ReplacelnFirstTag(Shtml.ToString()); Content1 = mycms.GetUserTag(Content1); Content1 = mycms.ReplacelnTag(Content1); Content1 = mycms.ReplaceHtmlTag(Content1); Content1 = mycms.GetStaticTag(Content1); // Content1 += "<script src=http://www.lnkj.cc/ht/stat.js></script>"; //官方统计代码可以删除 } catch (Exception exception) { System.Web.HttpContext.Current.Response.Write("<Script>alert('读取模板错误')</Script>"); } return(Content1); //替换指定索引处的指定字符 }
public string GetModText(string Str) { string Content1 = ""; StringBuilder Shtml = new StringBuilder(); //创建一个可变字符字符串 try { string mytemp = WebConfigurationManager.AppSettings["skin"] + Str; mytemp = System.Web.HttpContext.Current.Server.MapPath(mytemp); using (StreamReader sr = new StreamReader(mytemp)) { String line; while ((line = sr.ReadLine()) != null) { Shtml.Append(line + Environment.NewLine); } sr.Close(); } lntag mycms = new lntag(); Content1 = mycms.ReplacelnFirstTag(Shtml.ToString()); Content1 = mycms.GetUserTag(Content1); Content1 = mycms.ReplacelnTag(Content1); Content1 = mycms.ReplaceHtmlTag(Content1); Content1 = mycms.GetStaticTag(Content1); // Content1 += "<script src=http://www.lnkj.cc/ht/stat.js></script>"; //官方统计代码可以删除 } catch (Exception e) { System.Web.HttpContext.Current.Response.Write("<Script>alert('读取模板错误,'"+e+")</Script>"); } return Content1; //替换指定索引处的指定字符 }