WEB开发网
开发学院WEB开发ASP.NET 将Asp.net页面输出为HTML 阅读

将Asp.net页面输出为HTML

 2004-07-10 16:56:20 来源:WEB开发网   
核心提示:smilnet [原作] c#代码:WebRequest mywebrq;WebResponse mywebresp;StreamReader sr;Streamwriter sw;PRivate void Page_Load(object sender,EventArgs e){mywebreq=WebRequest

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

}

Tags:Asp net 页面

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接