自动生成HTML的一段程序
<%
if SaveFile("list.htm","http://192.168.1.4:920/lcy.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 ifEnd function
%>
if SaveFile("list.htm","http://192.168.1.4:920/lcy.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 ifEnd function
%>