Ok Guys i will show you how to make and advanced file downloader. You will need:
Ok Heres the TUT.
1. Make a new project named Advanved file downloader.
2. Add 2 buttons, a textbox, and a progress bar.
3. Name one button "Save As",and the other "Download"
4. Double click Save As and paste this code.
Code:
Dim save AsNew SaveFileDialog
save.Title = "Advanced Downloader"
save.ShowDialog()
TextBox1.Text = save.FileName
5. Double click Download and paste this code.
Code:
httpclient = New WebClient
Dim sourceurl = ("http://failblog.files.*********.com/2009/12/epic-fail-7-11-fail.jpg")
Dim filedir = TextBox1.Text
ProgressBar1.Minimum = "0"
ProgressBar1.Maximum = "100"
Try
httpclient.DownloadFileAsync(New Uri(sourceurl), (filedir))
Catch ex As Exception
'do nothing
EndTry
6. Now after the "end sub" of that code paste:
Code:
PrivateSub httpclient_DownloadProgressChanged(ByVal sender AsObject, ByVal e As System.Net.DownloadProgressChangedEventArgs) Handles httpclient.DownloadProgressChanged
ProgressBar1.Value = e.ProgressPercentage
EndSub
Note: This is the download percent
7. Now above
PublicClass Form1 paste :
8. No under public class form 1 paste:
Code:
PrivateWithEvents httpclient As WebClient
Follow these steps correctly, run debug, select a save spot and download the picture.
Make Sure To add .jpg to the end of you file name or else it will not show up as a picture.
Aight guys thats my TUT on how to make a basic downloader. Thank if you want more.