asp:生成静态页面函数

2018-09-06 11:40

阅读:355

  复制代码 代码如下:
<%
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
%>


评论


亲,登录后才可以留言!