七彩课堂[网页设计知识系列]
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
%>
信息推荐
财经资讯 | 电子商务 | 搜索营销 | 设计学院 | 健康常识 | 养生保健 | 节日祝福 | 民俗文化 | 星座命理
星座运势 | 生日短信 | 新年短信 | 传统节日 | 奇闻异事 | 百姓健康 | 趣闻轶事 | 祝福的话 | 手机短信
© 2005-2016 Qicaispace.Com