静态页面生成是这样字吗?
string url = Server.MapPath( "end.htm ");
Encoding en = Encoding.GetEncoding( "gb2312 ");
StreamReader sr = null;
StreamWriter sw = null;
string str = " ";
//读取
try
{
sr = new StreamReader(url, en);
str = sr.ReadToEnd();
}
catch
{
}
sr.Close();
string filename = DateTime.Now.ToString( "yyyyMMddHHmmss ") + ".htm ";
str = str.Replace( "$title$ ", readcom());
//生成静态页面
try
{
sw = new StreamWriter(Server.MapPath( "htm/ ") + filename, false, en);
sw.Write(str);
sw.Flush();
}
catch
{
}
finally
{
sw.Close();
Response.Write( "恭喜 <a href=htm/ " + filename + " target=_blank> " + filename + " </a> 已经生成,保存在htm文件夹下! ");
}
------解决方案--------------------
------解决方案--------------------
------解决方案--------------------
------解决方案--------------------