2020年7月6日 星期一

vb.net 取得下載EVENT [Get Download EVENT Listener]


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
Imports System.Net

    Dim intCount As Integer = 0
    Dim wc As WebClient

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            wc = New WebClient()
            AddHandler wc.DownloadFileCompleted, AddressOf wc_DownloadFileCompleted
            wc.DownloadFileAsync(New Uri("https://www.google.com.sv/images/srpr/logo11w.png"), "C:\\Google.jpg")
    End Sub







1
2
3
4
5
6
    Private Sub wc_DownloadFileCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs)
        'deine Aktionen
        intCount = intCount + 1
        If intCount >= lstTemp.Items.Count Then
        End If
    End Sub



沒有留言:

張貼留言