·您现在的位置: 云翼网络 >> 文章中心 >> 网站建设 >> 网站建设开发 >> ASP.NET网站开发 >> 将Asp.Net页面输出为HTML
c#代码:
WebRequest mywebrq;
WebResponse mywebresp;
StreamReader sr;
Streamwriter sw;
PRivate void Page_Load(object sender,EventArgs e)
{
mywebreq=WebRequest.Create(http://localhost/Test.aspx);
mywebresp=mywebreq.GetResponse();
sr=new streamReader(mywebresp.GetResponsestream());
strHtml=sr.ReadToEnd();
sw=File.CreateText(server.mappath("Test.htm"));
sw.writeling(strHtml);
sw.close();
Response.writeFile(Server.Mappath("Test.htm"));
}