//生成HTML页
![]()
public static bool WriteFile(string strText,string strContent,string strAuthor)
![]()
![]()
{
![]()
string path = HttpContext.Current.Server.MapPath("/news/");
![]()
Encoding code = Encoding.GetEncoding("gb2312");
![]()
// 读取模板文件
![]()
string temp = HttpContext.Current.Server.MapPath("/news/text.html");
![]()
StreamReader sr=null;
![]()
StreamWriter sw=null;
![]()
string str="";
![]()
try
![]()
![]()
{
![]()
sr = new StreamReader(temp, code);
![]()
str = sr.ReadToEnd(); // 读取文件
![]()
}
![]()
catch(Exception exp)
![]()
![]()