asp.net:aspx页面转换成xml
我在做一个网站的rss,运行出来的.aspx页面是xml格式的,我想把这个.aspx页面直接转换成.xml文件,请问该怎么做?如果能实现我一定把分补上!...
我在做一个网站的rss,运行出来的.aspx页面是xml格式的,我想把这个.aspx页面直接转换成.xml文件,请问该怎么做?如果能实现我一定把分补上!
展开
展开全部
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);
}
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);
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询