Quantcast
Channel: VB.Net Download Problemi (KOD)
Viewing all articles
Browse latest Browse all 2

VB.Net Download Problemi (KOD)

$
0
0
Selamın Aleyküm arkadaşlar bir sorum olacaktı (inşallah cevap gelir)
__________________________________________________ ____________
Vb.net'te
My.Computer.Network.DownloadFile()

Koduyla indirmeyaptığımda program kasıyor. Farklı bir kod da buldum =
__________________________________________________ ____________
Fakat ben alttaki kodda 2. bir indirme koyduğumda 
_WebClient.DownloadFileAsync(New Uri("http://dosyaurl.com"), Application.StartupPath& "\kayıt yeri")
_WebClient.DownloadFileAsync(New Uri("http://dosyaurl2.com"), Application.StartupPath& "\kayıt yeri")

Bunun gibi
WebClient eşzamanlı G/Ç işlemlerini desteklemiyor. Hatası alıyorum.
__________________________________________________ ____________
İsteğim:
Bu alttaki kodlarla yukarıdaki koddaki gibi 2 dosya indirmek istiyorum.
Ya da En üstteki kodla program donmadan indirme yapmak istiyorum.

__________________________________________________ ____________
Public Sub DownloadFile(ByVal _URL As String, ByVal _SaveAs As String)
Try
Dim _WebClient As New System.Net.WebClient()
_WebClient.DownloadFile(_URL, _SaveAs)
Catch _Exception As Exception
Console.WriteLine("Exception caught in process: {0}", _Exception.ToString())
End Try
End Sub


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

' Disable download button to a**** clicking again while downloading the file
Button1.Enabled = False
' Downloads, to a local file, the resource with the specified URI. 
' This method does not block the calling thread.
For Each
Dim _WebClient As New System.Net.WebClient()
AddHandler _WebClient.DownloadFileCompleted, AddressOf _DownloadFileCompleted
AddHandler _WebClient.DownloadProgressChanged, AddressOf _DownloadProgressChanged
Dim _WebClient As New System.Net.WebClient()
_WebClient.DownloadFileAsync(New Uri("http://dosyaurl.com"), Application.StartupPath& "\kayıt yeri")


End Sub


Private Sub _DownloadFileCompleted(ByVal sender As Object, ByVal e As System.EventArgs)

' File download completed
Button1.Enabled = Enabled
MessageBox.Show("Download completed")
End Sub
Private Sub _DownloadProgressChanged(ByVal sender As Object, ByVal e As System.Net.DownloadProgressChangedEventArgs)
' Update progress bar
ProgressBar1.Value = e.ProgressPercentage
End Sub

Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images