'将原链接改为新链接
oril = Mid(strData, po1 + 1, po2 - po1 - 1)
'如果有引号,去掉引号
ln = Replace(oril, """", "", vbTextCompare)
newl = Right(ln, Len(ln) - InStrRev(ln, "/"))
whostr = whostr & newl
If ln <> "" Then
'判定文件是否下载过。
If fileexists(spath & newl) = False Then
links(i) = addsuf & ln
i = i + 1
Else
lmtime = inet1.getheader("Last-modified")
Set f = fs.getfile(spath & newl)
ctime = f.datecreated
'判断文件是否更新
If DateDiff("s", lmtime, ctime) < 0 Then
i = i + 1
End If
End If
End If
po1 = InStr(po2 + 1, strData, "href=", vbTextCompare) + 5
Loop
newstr = Mid(strData, po2)
whostr = whostr + newstr
Set a = fs.createtextfile(spath & fname, True)
a.Write whostr
a.Close
k = i
Else
Dim vtData As Variant
Dim b() As Byte
Dim bDone As Boolean: bDone = False
vtData = Inet2.GetChunk(1024, icByteArray)
Do While Not bDone
b() = b() & vtData
vtData = Inet2.GetChunk(1024, icByteArray)
If Len(vtData) = 0 Then
bDone = True
End If
Loop