StreamReader sr;
StreamWriter sw;
WebRequest HttpWebRequest = WebRequest.Create(url);
WebResponse HttpWebResponse =HttpWebRequest.GetResponse();
sr=new StreamReader(HttpWebResponse.GetResponseStream(),System.Text.Encoding.Default);
string strHtml=sr.ReadToEnd();
sw=File.CreateText(Server.MapPath("html/default.htm"));
sw.WriteLine(strHtml);
sw.Close();
Response.WriteFile(Server.MapPath("html/default.htm"));
先把ASPX的HTML代码读出来,然后写到HTML文件里
asp.net生成静态页
最新推荐文章于 2021-06-03 15:29:35 发布