[VB.NET]Downloader Tutorial Hardness: Easy
Visual Basic Downloader Tutorial
So In This Tutorial We Are Going To Make A Downloader Cuse Aparently I Need 25 or 20 Posts To Add Links And I Want To Share My Knowladge With You
So Let's Get Started
1. Creating The Forum
Ok So We Need To Make A Forum We We Are Using Visual Studio/Basic To Make The Program So Create A Forum And Add 2 Labels, 2 TextBoxes, 1 Save File Dialog, 1 Progress Bar And 3 Buttons
And Put Them Like This:
Next Double Press On The Exit Button And Type: End
Next All The Way On Top Put Above Public Class Form1 This: Imports System.Net
Next Double Click On The Browse Button And Type This In:
Code
SaveFileDialog1.ShowDialog()
TextBox2.Text = SaveFileDialog1.FileName
Next Double Click On The Download Button And Put This Above Button Sub Of Downloader Button:
Code
Public WithEvents download As WebClient
Next In The Button Sub Of Download Button Write This In:
Code
download = New WebClient
download.DownloadFileAsync(New Uri(TextBox1.Text), TextBox2.Text)
Next Under The Tabs Press And Select download And Next To It There Is Another Combo Box There Find And Press On Download Progress Changed
The Write In This Code:
Code
ProgressBar1.Value = e.ProgressPercentage
And There You Go Full Code Here:
Full Code
Imports System.Net
Public Class Form1
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
End
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
SaveFileDialog1.ShowDialog()
TextBox2.Text = SaveFileDialog1.FileName
End Sub
Public WithEvents download As WebClient
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
download = New WebClient
download.DownloadFileAsync(New Uri(TextBox1.Text), TextBox2.Text)
End Sub
Private Sub download_DownloadProgressChanged(sender As Object, e As DownloadProgressChangedEventArgs) Handles download.DownloadProgressChanged
ProgressBar1.Value = e.ProgressPercentage
End Sub
End Class