我正在尝试从服务器和" DownloadFileCompleted"下载文件。事件没有被调用。 有人知道为什么吗?
来源:
Public Event DownloadFileCompleted As AsyncCompletedEventHandler
Public Sub DownloadCompleted(sender As Object, e As AsyncCompletedEventArgs)
MsgBox("Downloaded")
End Sub
Private Function DLOAD()
Try
Dim WebClientT As New System.Net.WebClient()
AddHandler WebClientT.DownloadFileCompleted, AddressOf DownloadFileCompletedD
ByteArray = WebClientT.DownloadData("https://ip/file.filetype")
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Function