//主要用到了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; }
Aps.net—(利用C#来生成静态页面)
最新推荐文章于 2021-09-24 17:05:11 发布