新闻系统、blog系统等都可能用到将动态页面生成静态页面的技巧来提高页面的访问速度。下面是利用XMLHTTP将动态网页生成静态网页的一段简单代码。
url = "http://www.csdn.net/"
set http=Server.createobject("Msxml2.XMLHTTP")
Http.open "GET",url,false
Http.send()
set objStream = Server.CreateObject("ADODB.Stream")
objStream.type = 1
objStream.open
objstream.write http.responseBody
objstream.saveToFile server.mappath("example.htm"),2
objstream.close
Response.Write "生成静态网页成功!<a href=example.htm>浏览生成的网页</a>"
http://blog.csdn.net/hellowutong/archive/2006/06/17/806440.aspx
set http=Server.createobject("Msxml2.XMLHTTP")
Http.open "GET",url,false
Http.send()
set objStream = Server.CreateObject("ADODB.Stream")
objStream.type = 1
objStream.open
objstream.write http.responseBody
objstream.saveToFile server.mappath("example.htm"),2
objstream.close
Response.Write "生成静态网页成功!<a href=example.htm>浏览生成的网页</a>"
http://blog.csdn.net/hellowutong/archive/2006/06/17/806440.aspx