代碼如下:
If localrow2.Item(7) = "" And Dir(Application.StartupPath & "\picdata\toppic\" & Replace(localrow2.Item(5), "/Storage/master/product/thumbs310/", "")) = "" Then
f(1) = New DownFile()
f(1).Url = "http://www.abc.com" & localrow2.Item(5)
f(1).File = Application.StartupPath & "\picdata\toppic\" & Replace(localrow2.Item(5), "/Storage/master/product/thumbs310/", "")
f(1).Down()
End If
If localrow2.Item(8) <> "" And Dir(Application.StartupPath & "\picdata\xgpic\" & Replace(localrow2.Item(8), "/Storage/master/effect/", "")) = "" Then
f(2) = New DownFile()
f(2).Url = "http://www.abc.com" & localrow2.Item(8)
f(2).File = Application.StartupPath & "\picdata\xgpic\" & Replace(localrow2.Item(8), "/Storage/master/effect/", "")
f(2).Down()
End If
If localrow2.Item(7) <> "" And Dir(Application.StartupPath & "\picdata\scpic\" & Replace(localrow2.Item(7), "/Storage/master/custom/", "")) = "" Then
f(3) = New DownFile()
f(3).Url = "http://www.abc.com" & localrow2.Item(7)
f(3).File = Application.StartupPath & "\picdata\scpic\" & Replace(localrow2.Item(7), "/Storage/master/custom/", "")
f(3).Down()
End If
Private Sub myWebclient_DownloadFileCompleted(ByVal sender As Object, ByVal e As System.Net.DownloadDataCompletedEventArgs) Handles myWebclient.DownloadDataCompleted
MsgBox("OK")
End Sub
downfile()部分代碼如下:
Public Class DownFile
Private WithEvents myWebclient As System.Net.WebClient
Public Url As String
Public File As String
Sub Down()
myWebclient = New Net.WebClient()
myWebclient.DownloadFileAsync(New Uri(Url), File)
End Sub
End Class
現在問題是,為啥 MsgBox("OK")就是不能執行?
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/130495.html
標籤:VB基礎類
