Ceriwis  

Go Back   Ceriwis > HOBI > Komputer & Teknologi > Programming

Programming Share, tanya jawab, saling bantu antar programmer dengan berbagai macam bahasa pemrograman.

Reply
 
Thread Tools
  #1  
Old 20th November 2011
JagoVB JagoVB is offline
Ceriwiser
 
Join Date: Nov 2011
Posts: 508
Rep Power: 14
JagoVB mempunyai hidup yang Normal
Default [ASK]Download manager vb.net

gan ane kan lagi rencanain buat browser yang ada download managernya... nah ane udah buat download managernya dan bisa download... masalahnya, downloadnya ga bisa di pause... ane mau tanya, code untuk pause download kayak apa gan



oh ya nih gan codingan ane


Spoiler for code:





Code:

Imports System.Net
Public Class Form1
Public WithEvents dl As New WebClient
Private Sub btnBrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBrowse.Click
With SaveFileDialog1
.InitialDirectory = System.Reflection.Assembly.GetExecutingAssembly.Lo cation
.Filter = "All File (*.*)|*.*"
.FilterIndex = 1
.RestoreDirectory = True
If SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
txtSave.Text = SaveFileDialog1.FileName
End If
End With
End Sub

Private Sub btnDownload_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDownload.Click
On Error GoTo err
dl.DownloadFileAsync(New Uri(txtUrl.Text), txtSave.Text)
Exit Sub
Err:
MsgBox("There was an error while downloading the file: " & _
Err.Description, MsgBoxStyle.Critical, _
"FATAL ERROR!")
End Sub

Private Sub dl_DownloadProgressChanged(ByVal sender As Object, ByVal e As System.Net.DownloadProgressChangedEventArgs) Handles dl.DownloadProgressChanged
PB.Value = e.ProgressPercentage
lblSize.Text = Int(e.BytesReceived / 1024) & " kB" & " / " & Int(e.TotalBytesToReceive / 1024) & " kB"
lblper.Text = e.ProgressPercentage & "%"
End Sub
End Class







bantuin ya gan

oh ya sama code untuk ngetahui speed downloadnya juga ya gan



Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


 


All times are GMT +7. The time now is 05:33 AM.


no new posts