![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
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();
kenkofox@qq.com
https://github.com/kenkozheng
欢迎投简历给我,一线大厂工作机会