asp生成静态页面的问题,执行特别慢。但是在本地测试的时候很快~
function makeindex(FileNameA,FileNameB)
FilePath = Server.MapPath("/")&"\"&FileNameA
strUrl = "http://"&Request.ServerVariables("SERVER_NAME")&"/"&FileNameB
'response.write strUrl&"生成---"&FileNameA&"<br>"
'创建objXmlHttp
dim objXmlHttp,binFileData,objAdoStream
set objXmlHttp = Server.CreateObject("Micro"&"soft"&".XML"&"HT"&"TP")'加"&"加"&"防止误杀
'set objXmlHttp = CreateObject("MSXML2.ServerXMLHTTP")'加"&"加"&"防止误杀
'objXmlHttp.open "GET",strUrl,false
objXmlHttp.open "POST",strUrl,false
objXmlHttp.send()
'
binFileData = objXmlHttp.responseBody
set objXmlHttp = nothing
'创建objAdoStream
set objAdoStream = Server.CreateObject("AD"&"ODB"&".Str"&"eam")'加"&"防止误杀
objAdoStream.Type = 1
objAdoStream.Open()
objAdoStream.Write(binFileData)
objAdoStream.SaveToFile FilePath,2
objAdoStream.Close()
set objAdoStream = nothing
end function
FilePath = Server.MapPath("/")&"\"&FileNameA
strUrl = "http://"&Request.ServerVariables("SERVER_NAME")&"/"&FileNameB
'response.write strUrl&"生成---"&FileNameA&"<br>"
'创建objXmlHttp
dim objXmlHttp,binFileData,objAdoStream
set objXmlHttp = Server.CreateObject("Micro"&"soft"&".XML"&"HT"&"TP")'加"&"加"&"防止误杀
'set objXmlHttp = CreateObject("MSXML2.ServerXMLHTTP")'加"&"加"&"防止误杀
'objXmlHttp.open "GET",strUrl,false
objXmlHttp.open "POST",strUrl,false
objXmlHttp.send()
'
binFileData = objXmlHttp.responseBody
set objXmlHttp = nothing
'创建objAdoStream
set objAdoStream = Server.CreateObject("AD"&"ODB"&".Str"&"eam")'加"&"防止误杀
objAdoStream.Type = 1
objAdoStream.Open()
objAdoStream.Write(binFileData)
objAdoStream.SaveToFile FilePath,2
objAdoStream.Close()
set objAdoStream = nothing
end function
问题补充:
一步一步排查后,发现执行到这句:objXmlHttp.send() 就死了~
这个是服务器那里出了问题呢?
[ 本帖最后由 ysf0181 于 2013-3-11 15:40 编辑 ]