CSDN博客

img vzxq

将Asp.net页面输出为HTML

发表于2004/9/14 10:27:00  526人阅读

smilnet [原作]

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

}

0 0

相关博文

我的热门文章

img
取 消
img