最新下载
热门教程
- 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="https://www.1*11*c*n.net /default.asp"
childName = "网站首页"
childUrl = "/index.html"
localPath = ""
case "1"
Curl="http://www.11*1c**n.ne t/news/index.asp"
childName = "新闻中心首页"
childUrl = "/news/index.html"
localPath = "/news"
case "2"
Curl="https://www.1*11*c*n.net /newhouse/index.asp"
childName = "新房网首页"
childUrl = "/newhouse/index.html"
localPath = "/newhouse"
case "3"
Curl="https://www.1*11*c*n.net /home/index.asp"
childName = "家居网首页"
childUrl = "/home/index.html"
localPath = "/home"
case "4"
Curl="https://www.1*11*c*n.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,"静态页面 生成完毕 " & Now() & "")
response.Redirect(request.ServerVariables("HTTP_REFERER"))
%>
相关文章
- 逆水寒焚香祭故人奇遇怎么过 07-08
- 炉石传说逃离紫罗兰监狱蜘蛛铺场德卡组代码分享 07-08
- 炉石传说 逃离紫罗兰监狱 麦琳口德卡组代码分享 07-08
- 苦等8年《太吾绘卷》1.0正式版上线:盘点2026年上半年上线的武侠游戏 07-08
- 黑色沙漠开发商披露未来计划《多可比》2028年上线 07-08
- 运营不到2年 《天堂》研发商放置类RPG《君主之旅》8月停运 07-08