//主要用到了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;
        }


 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-31
  • 2022-12-23
  • 2021-07-21
  • 2022-12-23
  • 2022-03-05
猜你喜欢
  • 2022-12-23
  • 2021-12-08
  • 2022-12-23
  • 2021-12-30
  • 2021-09-13
相关资源
相似解决方案