Code
string strUrl = "download.aspx";
string strSavePath = "E:/kenko.html";
StringWriter strHTML = new StringWriter();
System.Web.UI.Page myPage = new Page();
myPage.Server.Execute(strUrl, strHTML, false); //将aspx文件在客户端显示的html内容读到了strHTML中
StreamWriter sw = new StreamWriter(strSavePath, false, System.Text.Encoding.UTF8);
sw.Write(strHTML.ToString()); //写入Html文件
strHTML.Close();
sw.Close();
string strUrl = "download.aspx";
string strSavePath = "E:/kenko.html";
StringWriter strHTML = new StringWriter();
System.Web.UI.Page myPage = new Page();
myPage.Server.Execute(strUrl, strHTML, false); //将aspx文件在客户端显示的html内容读到了strHTML中
StreamWriter sw = new StreamWriter(strSavePath, false, System.Text.Encoding.UTF8);
sw.Write(strHTML.ToString()); //写入Html文件
strHTML.Close();
sw.Close();