<%
Function GetWebData(byval strUrl)
dim curlpath
dim Retrieval
Set Retrieval = Server.CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Get", strUrl, False, "", ""
.Send
GetWebData =.ResponseBody
End With
Set Retrieval = Nothing
End Function
sub SaveImg(FileName,Data)
set ads=server.CreateObject("Adodb.Stream")
with ads
.Type=1
.Open
.Write Data
.SaveToFile server.MapPath(FileName),2
.Cancel()
.Close()
end with
set ads=nothing
end sub
dim imgurl
dim aryFileName
imgurl="http://bbs.dvbbs.net/images/LOGO.GIF" '图片远程地址。
aryFileName=split(imgUrl,"/")
call SaveImg(aryFileName(ubound(aryFileName)),GetWebData(imgurl))
%>
本程序在 win2K server/IIS5.0/IE6 下测试成功。
54NB聯盟(原wc公司)荣誉出品(2003-09-1)