会员
周边
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
冷风.NET
---默默無聞
博客园
::
首页
::
新随笔
::
联系
::
订阅
::
管理
將aspx頁面以html形式輸出
Posted on
2004-11-25 09:35
冷风.net
阅读(
1494
) 评论(
0
)
收藏
举报
/**/
///
<summary>
///
將aspx頁面以html輸出
///
</summary>
public
class
Class2
{
string
curUrl
=
""
;
//
當前路徑;
System.Web.HttpContext context
=
HttpContext.Current;
//
當前頁
System.Net.WebRequest request;
System.Net.WebResponse response;
System.IO.StreamReader sr;
System.IO.StreamWriter sw;
public
Class2(
string
page)
{
this
.curUrl
=
context.Server.MapPath(page);
}
public
void
WritePage()
{
string
strHTML
=
String.Empty;
request
=
WebRequest.Create(
this
.curUrl);
response
=
request.GetResponse();
sr
=
new
System.IO.StreamReader(response.GetResponseStream());
strHTML
=
sr.ReadToEnd();
sw
=
System.IO.File.CreateText(context.Server.MapPath(
"
test.htm
"
));
sw.WriteLine(strHTML);
sw.Close();
context.Response.WriteFile(context.Server.MapPath(
"
test.htm
"
));
}
}
刷新页面
返回顶部
博客园
© 2004-2026
浙公网安备 33010602011771号
浙ICP备2021040463号-3