未调用DownloadFileCompleted事件

时间:2018-03-03 17:46:50

标签: vb.net network-programming webclient-download

我正在尝试从服务器和" 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

0 个答案:

没有答案