您的位置:首页 > 编程语言 > C#

Aps.net—(利用C#来生成静态页面)

2011-11-08 17:42 302 查看
//主要用到了System.Net.WebClient类
if (Request.QueryString["r"] != "1")
{
if (System.IO.File.Exists(Server.MapPath("/html/" + Request.QueryString["ID"] + ".html")))
{
Response.Redirect("/html/" + Request.QueryString["ID"] + ".html");
return;
}
else
{
new System.Net.WebClient().DownloadFile("http://localhost/test.aspx?ID=" + Request.QueryString["ID"] + "&r=1", Server.MapPath("/html/" + Request.QueryString["ID"] + ".html"));
Response.Redirect("/html/" + Request.QueryString["ID"] + ".html");
return;
}
Response.Redirect("/html/" + Request.QueryString["ID"] + ".html");
return;
}


 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  c#