asp.net:aspx页面转换成xml
来源:百度知道 编辑:UC知道 时间:2024/04/29 13:10:40
write some automation code to access your page and save the response
or override Render method to save the output, for example (make sure to give ASPNET account write permissions in the current directory)
protected override void Render(HtmlTextWriter output)
{
StringWriter sw;
HtmlTextWriter htmltw;
sw = new StringWriter();
htmltw = new HtmlTextWriter(sw);
base.Render(htmltw);
String sTemp = sw.ToString();
StreamWriter writer = File.CreateText(Server.MapPath("somehtml.html"));
writer.Write(sTemp);
writer.Close();
//write it out to the browser
output.Write(sTemp);
}