<%
'============================================
'函数作用:远程图片自动保存到本地服务器
'修改时间:2006-7-3 21:21
'传人参数:
' localfilename:本地文件名
' remotefileurl:远程文件url
'============================================
sub saveremotefile(localfilename,remotefileurl)
dim ads,retrieval,getremotedata
set retrieval = server.createobject("microsoft.xmlhttp")
with retrieval
.open "get", remotefileurl, false, "", ""
.send
getremotedata = .responsebody
end with
set retrieval = nothing
set ads = server.createobject("adodb.stream")
with ads
.type = 1
.open
.write getremotedata
.savetofile localfilename,2
.cancel()
.close()
end with
set ads=nothing
end subremotefileurl = "yun_qi_img/mainlogo.gif" '获取远程图片
fileext = right(remotefileurl,4) '获取远程图片的格式
首页 1 2 末页
时间: 2025-01-23 18:24:24