七彩课堂[网页设计知识系列]
ASP生成静态页面的另一种方法
<%
if SaveFile("/htm/list.htm","http://qicaispace.net/asp/list.asp") then
Response.write "ASP生成静态页面已经成功了!"
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
%>
 
信息推荐
资讯中心 | 电子商务 | 搜索营销 | 设计学院 | 中医养生 | 养生保健 | 节日祝福 | 民俗文化 | 奇闻趣事
建站知识 | 人世百态 | 网站导航 | 传统节日 | 搜索热点 | 星座运势 | 趣闻轶事 | 祝福的话 | 短信大全
© 2023 QicaiSpace.Com