主要原理就是用正則判斷 <img> 的<src>屬性
函數如下
以下是引用片段
Function ShowPic(str)
Set objRegExp = New Regexp
objRegExp
objRegExp
objRegExp
strs=trim(str)
Set Matches =objRegExp
For Each Match in Matches
RetStr = RetStr &getimgs( Match
Next
ShowPic = RetStr
End Function
Function getimgs(str)
getimgs=
Set objRegExp
objRegExp
objRegExp
objRegExp
set mm=objRegExp
For Each Match
getimgs=getimgs&left(Match
next
End Function
function getHTTPPage(url)
on error resume next
dim http
set (
Http
Http
if Http
exit function
end if
getHTTPPage=Http
set http=nothing
if err
end function
function saveimage(from
dim geturl
geturl=trim(from)
imgs=gethttppage(geturl)
Set objStream = Server
objStream
objStream
objstream
objstream
objstream
set objstream=nothing
end function
Dim strpic
strpic = ShowPic(
strpic = Split(strpic
If UBound(strpic) >
For i =
fname=cstr(i&mid(strpic(i)
saveimage(strpic(i)
Next
Else
End If
From:http://tw.wingwit.com/Article/program/net/201311/11722.html