将Asp.net页面输出为HTML

 c#代码:

WebRequest mywebrq;

WebResponse mywebresp;

StreamReader sr;

Streamwriter sw;

Private void Page_Load(object sender,EventArgs e)

{

mywebreq=WebRequest.Create(aspx">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"));

}
http://comments.yesky.com/l/6603882/311124/0,0/0.shtml?back=true
posted @ 2006-08-02 10:32  Nina  阅读(310)  评论(0编辑  收藏  举报