asp:生成靜態(tài)頁面函數(shù)
更新時(shí)間:2006年08月08日 00:00:00 作者:
復(fù)制代碼 代碼如下:
<%
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
%>
相關(guān)文章
asp 使用正則表達(dá)式替換word中的標(biāo)簽,轉(zhuǎn)為純文本
asp里使用正則表達(dá)式清除后臺(tái)編輯器里復(fù)制粘貼內(nèi)容的word格式,將其轉(zhuǎn)換成純文本2010-04-04asp中常用的字符串安全處理函數(shù)集合(過濾特殊字符等)
在asp編寫中,我們需要注意特殊字符串的處理,防止被黑客利用。使用asp的朋友一定要參考下。2011-01-01asp 得到動(dòng)態(tài)數(shù)組中元素的個(gè)數(shù)
主要用到了 ubound(數(shù)組的名稱) 這個(gè)函數(shù),這個(gè)函數(shù)用來求數(shù)組的上邊界。2009-06-06用asp實(shí)現(xiàn)的獲取文件夾中文件的個(gè)數(shù)的代碼
asp實(shí)現(xiàn)的返回指定文件夾中文件的數(shù)目的代碼2009-12-12asp中獲取當(dāng)前頁面的地址與參數(shù)的函數(shù)代碼
asp中獲取當(dāng)前頁面的地址與參數(shù)的函數(shù)代碼,經(jīng)常需要用得到,特整理下,方便需要的朋友。2011-01-01ASP調(diào)用遠(yuǎn)程XML數(shù)據(jù)的代碼(alexa排名數(shù)據(jù))
調(diào)用網(wǎng)易新聞的XML數(shù)據(jù)為例進(jìn)行講解如果通過ASP遠(yuǎn)程調(diào)取XML文件,并讀出數(shù)據(jù)。其實(shí)我們之前就使用了asp讀取alexa官方的數(shù)據(jù)。2011-09-09