//读取html文件
string Path = Server.MapPath("../NewFiles");
//Response.Write( Path + "[url=file:]//"+strFileName[/url]);
StringBuilder strhtml = new StringBuilder();
using (StreamReader sr = new StreamReader(Path +"/"+ "MasterPage.htm"))
{
string online;
while ((online = sr.ReadLine()) != null)
{
strhtml.Append(online);
}
sr.Close();
}
DataSet ds = (new IMessage()).ReturnDataSet("select top 1 TileId from TitleTable order by TileId desc", DataPath);
string bid = ds.Tables[0].Rows[0][0].ToString();
//替换掉标志
strhtml = strhtml.Replace("Title", strTitle);
strhtml = strhtml.Replace("Content", strcontent);
strhtml = strhtml.Replace("bid",bid);
//生成HTML文件
FileInfo fino = new FileInfo(Path + "/" + strFileName);
using (FileStream ft = fino.OpenWrite())
{
StreamWriter sw = new StreamWriter(ft, Encoding.Default);
sw.Write(strhtml);
sw.Flush();
sw.Close();
}
string Path = Server.MapPath("../NewFiles");
//Response.Write( Path + "[url=file:]//"+strFileName[/url]);
StringBuilder strhtml = new StringBuilder();
using (StreamReader sr = new StreamReader(Path +"/"+ "MasterPage.htm"))
{
string online;
while ((online = sr.ReadLine()) != null)
{
strhtml.Append(online);
}
sr.Close();
}
DataSet ds = (new IMessage()).ReturnDataSet("select top 1 TileId from TitleTable order by TileId desc", DataPath);
string bid = ds.Tables[0].Rows[0][0].ToString();
//替换掉标志
strhtml = strhtml.Replace("Title", strTitle);
strhtml = strhtml.Replace("Content", strcontent);
strhtml = strhtml.Replace("bid",bid);
//生成HTML文件
FileInfo fino = new FileInfo(Path + "/" + strFileName);
using (FileStream ft = fino.OpenWrite())
{
StreamWriter sw = new StreamWriter(ft, Encoding.Default);
sw.Write(strhtml);
sw.Flush();
sw.Close();
}