objXmlHttp.open "GET","http://"&request.Serv">

ASP生成静态首页的示例代码

80酷酷网    80kuku.com

  

简单点的,ASP生成静态首页的示例代码

<%
dim objXmlHttp,binFileData,objAdoStream
set objXmlHttp = Server.CreateObject("Microsoft.XMLHTTP")
objXmlHttp.open "GET","http://"&request.ServerVariables("HTTP_HOST")&"/index1.asp",false
objXmlHttp.send()
binFileData = objXmlHttp.responseBody
set objAdoStream = Server.CreateObject("ADODB.Stream")
objAdoStream.Type = 1
objAdoStream.Open()
objAdoStream.Write(binFileData)
objAdoStream.SaveToFile server.MapPath("../index.html"),2
objAdoStream.Close()
set objAdoStream=nothing
set objXmlHttp=nothing
response.write"<script language=javascript>alert('首页生成完成!');this.location.href='manage_main.asp';</script>"
%>

分享到
  • 微信分享
  • 新浪微博
  • QQ好友
  • QQ空间
点击: