protected void Butn_Default_Click(object sender, EventArgs e)
{
WebRequest wReq = WebRequest.Create("http://www.erasignal.com/Default.aspx");//地址改成你想要生成静态页的地址
WebResponse wResp = wReq.GetResponse();
Stream respStream = wResp.GetResponseStream();
StreamReader reader = new StreamReader(respStream, System.Text.Encoding.GetEncoding("gb2312"));//编码格式以自己网站的编码格式为准
string str = reader.ReadToEnd();
StreamWriter sw = new StreamWriter(Server.MapPath("~/index.html"), false, System.Text.Encoding.GetEncoding("gb2312"));
sw.Write(str);
str = "";
sw.Flush();
sw.Close();
}
asp.net生成静态页面
最新推荐文章于 2015-04-21 00:14:25 发布