asp:生成静态页面函数
2018-09-06 11:40
复制代码 代码如下:
<%
ifSaveFile(/htm/list.htm,
Response.write已生成
else
Response.write没有生成
endif
functionSaveFile(LocalFileName,RemoteFileUrl)
DimAds,Retrieval,GetRemoteData
OnErrorResumeNext
SetRetrieval=Server.CreateObject(Microso&ft.XM&LHTTP)
WithRetrieval
.OpenGet,RemoteFileUrl,False,,
.Send
GetRemoteData=.ResponseBody
EndWith
SetRetrieval=Nothing
SetAds=Server.CreateObject(Ado&db.Str&eam)
WithAds
.Type=1
.Open
.WriteGetRemoteData
.SaveToFileServer.MapPath(LocalFileName),2
.Cancel()
.Close()
EndWith
SetAds=nothing
iferr<>0then
SaveFile=false
err.clear
else
SaveFile=true
endif
Endfunction
%>
上一篇:ASP开发中数据库文件调用(2)
下一篇:百度小偷