求助,大量下载图片问题
求助,大量下载图片问题
Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean
Dim lngRetVal As Long
lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
If lngRetVal = 0 Then
DownloadFile = True
End If
End Function
Private Sub downpic()
On Error Resume Next
For I = 0 To List1.ListCount -1
DoEvents
DownloadFile List1.List(I), App.Path & "" & "pic" & "" & i
Next
End Sub
这样的话,下载会很卡....因为我的list列表里面有700个项,也就是要下载700多张图片
有没有什么好的方法可以解决这个假死或者卡的问题?
[解决办法]
把doevents放到DownloadFile里咯或者找一下其他的涵数咯.
Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean
Dim lngRetVal As Long
lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
doevents
If lngRetVal = 0 Then
DownloadFile = True
End If
End Function