HELP! Download thing
Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
First off....You need to figure out how you are going to populate the ComboBox.
Are you using a datasource, textfile, XML file, or are you going to hard code the links in the ComboBox.
As far as downloading from the link. There a several ways of doing it.
But! If this is a software that you entend on letting others use this project you have to think about Firewall issues.
Scottie
Are you using a datasource, textfile, XML file, or are you going to hard code the links in the ComboBox.
As far as downloading from the link. There a several ways of doing it.
But! If this is a software that you entend on letting others use this project you have to think about Firewall issues.
Scottie
I'm going to use a stg file [list.stg]
Code: Select all
But i'm open to use something else...[Download 1]
site=http://xxx.
[Download 2]
site=http://xxx.
[Download 3]
site=http://xxx.
OK!
So what type of files will be downloaded?
Is this for a Update feature for a project?
Is this just an app from users to download what ever you are offereing?
These are questions you need to think about.
So what type of files will be downloaded?
Is this for a Update feature for a project?
Is this just an app from users to download what ever you are offereing?
These are questions you need to think about.
Code: Select all
The FILENAME.EXT needs to be the original filename that is being downloadedMy.Computer.Network.DownloadFile(ComboBox1.SelectedItem, My.Computer.FileSystem.SpecialDirectories.Desktop + "\" + "FILENAME.EXT")
This will download the file to the user Desktop
From what I can tell, you have to use a BackgroundWorker to download the file and as the file downloads, it updates the ProgressBar. I personaly do not how todo this with a BackGroundWorker. Do a Google search on BackgroundWorker Downloadfile in vb.net or vb 2008. See what you come up with.
Hello,
To do a progress bar you could use this:
First the part the downloads the file:
To do a progress bar you could use this:
First the part the downloads the file:
Code: Select all
Then just add these subs in your code:Dim WebUpdate As System.Net.WebClient
WebUpdate = New System.Net.WebClient()
AddHandler WebUpdate.DownloadProgressChanged, AddressOf OnDownloadProgressChanged2
AddHandler WebUpdate.DownloadFileCompleted, AddressOf OnFileDownloadCompleted2
WebUpdate.DownloadFileAsync(New Uri("FILE URL HERE"), "SaveFileAsName.exe")
Code: Select all
Hope that helps cooll;Private Sub OnDownloadProgressChanged(ByVal sender As Object, ByVal e As System.Net.DownloadProgressChangedEventArgs)
Dim totalSize As Long = e.TotalBytesToReceive
Dim downloadedBytes As Long = e.BytesReceived
Dim percentage As Integer = e.ProgressPercentage
ProgressBar1.Increment(percentage)
End Sub
Private Sub OnFileDownloadCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs)
If e.Cancelled Then
ElseIf Not e.Error Is Nothing Then
'FILE CANNOT BE DOWNLOADED - DO SOMETHING HERE
Else
'FILE HAS DOWNLOADED SUCCESSFULLY - DO SOMETHING HERE
End If
End Sub
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
Copyright Information
Copyright © Codenstuff.com 2020 - 2023