该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
将asp页面转换成html页面
Sub GenFile(id)
dim objXmlHttp
set objXmlHttp = Server.CreateObject("Microsoft.XMLHTTP")
objXmlHttp.open "GET","http://www.xxx.com/product.asp?id=" & id ,false
objXmlHttp.send()
Dim binFileData
binFileData = objXmlHttp.responseBody
Dim objAdoStream
set objAdoStream = Server.CreateObject("ADODB.Stream")
objAdoStream.Type = 1
objAdoStream.Open()
objAdoStream.Write(binFileData)
objAdoStream.SaveToFile Server.MapPath("/product") & "\" & id & ".htm",2
objAdoStream.Close()
dim sI,sA
sI=""
sA=""
dim objFSO,objFile
set objFSO = server.CreateObject("Scripting.FileSystemObject")
set objFile = objFSO.OpenTextFile(Server.MapPath("/product") & "\" & id & ".htm")
while not objFile.AtEndOfStream
sI = objFile.readline()
sA = sA & sI
wend
objFile.close
set objFile = nothing
''处理过程
dim sR
sR = replace(sA,"images/","../images/")
sR = replace(sR,"admin/../","../admin/")
sR = replace(sR,"class.asp","../class.asp")
sR = replace(sR,"cat.asp","../cat.asp")
sR = replace(sR,"research.asp","../research.asp")
sR = replace(sR,"help","../help")
sR = replace(sR,"mess.asp","../mess.asp")
sR = replace(sR,"index.asp","../index.asp")
sR = replace(sR,"addto.asp","../addto.asp")
''重新写入
dim objFileW
set objFileW = objFSO.CreateTextFile(Server.MapPath("/product") & "\" & id & ".htm",true)
objFileW.WriteLine sR
objFileW.close
set objFileW = nothing
set objFSO = nothing
end sub