日期:2014-05-17 浏览次数:20591 次
public void CreatHtml() { Encoding code = Encoding.GetEncoding("utf-8"); StreamReader sr = null; StreamWriter sw = null; string str = null; System.Net.WebResponse myTemp = null; System.Net.WebRequest temp = System.Net.WebRequest.Create("http://www.yl918.com"); myTemp = temp.GetResponse(); sr = new StreamReader(myTemp.GetResponseStream(), code); //读取 try { sr = new StreamReader(myTemp.GetResponseStream(), code); str = sr.ReadToEnd(); } catch (Exception ex) { throw ex; } finally { sr.Close(); } string fileName = "index.html"; //写入 try { sw = new StreamWriter(Server.MapPath("~") + "\\" + fileName, false, code); sw.Write(str); sw.Flush(); } catch (Exception ex) { throw ex; } finally { sw.Close(); } }
作者:David.xu 文章出处:yl加油吧 (http://www.yl918.com/17579.aspx)
------解决方案--------------------
为什么要让网页静态化,生成静态的程序来做网站的好处?
如今不少客户在QQ上咨询我们,网站生成静态HTML有什么好处,现在归纳直来一并答复为什么让网页”静”下来,生成静态HTML有什么好处呢?
我们的回答:
在三年前,有百分之八十的网站要求做成动态的。也就是从那个时候也就是ASP的发展高峰期。一些静态网页也要求做成动态网站。但是这二年来,网站要求做成静态的。也就是网页要求静态化。
为什么会有这样的变化?到底意味着什么?