English(beta)
hfyb的Blog 页面正在加载中 .....

将Asp.net页面输出为HTM

引自http://www.dev-coffee.com/ASPNET/jiang-Asp-.net-yemian-shuchu-wei-HTM-6097




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"));


}

posted on 2007-02-28 00:42  hfyb  阅读(289)  评论(0编辑  收藏  举报

导航