最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp根据判断生成静态html页面代码
时间:2022-07-02 23:02:34 编辑:袖梨 来源:一聚教程网
<%
dim childType,Curl,childName,childUrl,localPath
childType = request.QueryString("childType")
select case childType
case "0"
Curl="http://www.111com.net /default.asp"
childName = "网站首页"
childUrl = "/index.html"
localPath = ""
case "1"
Curl="http://www.111cn.ne t/news/index.asp"
childName = "新闻中心首页"
childUrl = "/news/index.html"
localPath = "/news"
case "2"
Curl="http://www.111com.net /newhouse/index.asp"
childName = "新房网首页"
childUrl = "/newhouse/index.html"
localPath = "/newhouse"
case "3"
Curl="http://www.111com.net /home/index.asp"
childName = "家居网首页"
childUrl = "/home/index.html"
localPath = "/home"
case "4"
Curl="http://www.111com.net /hirehouses/index.asp"
childName = "租售网首页"
childUrl = "/oldhouse/index.html"
localPath = "/oldhouse"
case else
end select
Function FSOchange(filename,Target)
Dim objFSO,objCountFile,FiletempData,HtmlOut
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objCountFile = objFSO.OpenTextFile(Server.MapPath(filename),1,True)
FiletempData = objCountFile.ReadAll
objCountFile.Close
Set HtmlOut = objFSO.CreateTextFile (server.MapPath(Target))
HtmlOut.WriteLine FiletempData
HtmlOut.close
Set objFSO = Nothing
End Function
Dim fn,DoUrl,ObjXmlHttp,BinFileData,ObjAdoStream,filepath
filepath = localPath & "/index_.html"
fn = server.MapPath(filepath)
DoUrl = Curl
'Dourl = Request("Url")
set ObjXmlHttp = Server.CreateObject("MSXML2.serverXMLHTTP")
ObjXmlHttp.open "GET",DoUrl,false
ObjXmlHttp.send()
BinFileData = objXmlHttp.responseBody
set ObjAdoStream = Server.CreateObject("ADODB.Stream")
ObjAdoStream.Type = 1
ObjAdoStream.Open()
ObjAdoStream.Write(BinFileData)
ObjAdoStream.SaveToFile fn,2
ObjAdoStream.Close()
set ObjAdoStream = nothing
set objxmlhttp = nothing
call FSOchange(localPath & "/index_.html",localPath & "/index.html")
'使用FSO读取文件内容的函数
Function FSOFileRead(filename)
Dim objFSO,objCountFile,FiletempData
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objCountFile = objFSO.OpenTextFile(Server.MapPath(filename),1,True)
FSOFileRead = objCountFile.ReadAll
objCountFile.Close
Set objCountFile=Nothing
Set objFSO = Nothing
End Function
call Lib.tipText(0,"静态页面 " & childName & " 生成完毕 " & Now() & "")
response.Redirect(request.ServerVariables("HTTP_REFERER"))
%>
相关文章
- 银与绯吉尔兰技能怎么样 吉尔兰战斗特性解析 07-14
- 异环异象管理局局长是谁 艾尔菲德角色详细介绍 07-14
- 欧意易ok官网下载版 欧意易app下载 07-14
- 迷你世界马车怎么做 马车制作方法介绍 07-14
- 碳碳岛许愿池有什么作用 许愿池建造方法介绍 07-14
- 最终幻想14水晶世界怎么招募雇员 招募雇员方法介绍 07-14