asp转静态出现的问题求救
我将网站上传到虚拟主机并生成了静态页面,第一次正常生成,但是第二次开始就不正常了,不管生成几次,前台的静态页面还是第一次生成时的页面,用ftp软件进入站点将所有.html文件删除后再生成,生成的.html文件居然还是第一次生成时的内容,在本地测试没有这情况。
--------------下面是我用的函数
<%
Function GetPage(url)
'获得文件内容
dim Retrieval
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Get", url, False ', "", ""
.Send
GetPage = BytesToBstr(.ResponseBody)
End With
Set Retrieval = Nothing
End Function
Function BytesToBstr(body)
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = "GB2312"
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
%>
<%
Function create_html(url,path)
on error resume next
response.write "开始转静态..."
code = GetPage(Url)
Set fs=Server.CreateObject("Scripting.FileSystemObject")
path=server.MapPath(path)
If (fs.FileExists(path)) Then
fs.DeleteFile(path)
End If
Set CrFi=fs.CreateTextFile(path)
Crfi.Writeline(code)
set CrFi=nothing
set fs=nothing
response.write "...<font color=red>更新完成!</font> <a href=indexto.asp>返回</a>"
end function
%>
然后这样调用
selectm="要转静态的地址"
sf="../index.html"
call (create_html(selectm,sf))
请高手指点。。这两天都在搞这个,都找不到方法。。快崩溃了。