在线建站培训
您的位置: 魔客吧 网络编程 ASP编程 查看内容

asp:生成静态页面函数

2017-7-21 08:30 | 发布者: moke | 栏目:ASP编程

复制代码 代码如下:

<%
if SaveFile("/htm/list.htm","http://www.xxx.com/asp/list.asp") then
Response.write "已生成"
else
Response.write "没有生成"
end if

function SaveFile(LocalFileName,RemoteFileUrl)
Dim Ads, Retrieval, GetRemoteData
On Error Resume Next
Set Retrieval = Server.CreateObject("Microso" & "ft.XM" & "LHTTP")
With Retrieval
.Open "Get", RemoteFileUrl, False, "", ""
.Send
GetRemoteData = .ResponseBody
End With
Set Retrieval = Nothing
Set Ads = Server.CreateObject("Ado" & "db.Str" & "eam")
With Ads
.Type = 1
.Open
.Write GetRemoteData
.SaveToFile Server.MapPath(LocalFileName), 2
.Cancel()
.Close()
End With
Set Ads=nothing
if err <> 0 then
SaveFile = false
err.clear
else
SaveFile = true
end if
End function
%>

魔客吧温馨提示:如果你正在寻找dedecms模板,那你可以到魔客吧的 dedecms模板 频道看看,相信一定能找到你喜欢的!

最新分享资源

最新评论

验证码 换一个