For example:
You click on Download 1 and it downloads the file to the desktop [the progressbar and the % thing have to work to]
Download 1,2 and 3 has different download links...
^NeedHelp
Re: HELP! Download thing
Posted: Sun Feb 21, 2010 9:23 pm
by Scottie1972
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.
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.
Re: HELP! Download thing
Posted: Sun Feb 21, 2010 9:37 pm
by NeedHelp
Download .exe files.
Users download what i am offering
The FILENAME.EXT needs to be the original filename that is being downloaded
This will download the file to the user Desktop
Re: HELP! Download thing
Posted: Sun Feb 21, 2010 10:16 pm
by NeedHelp
The file is .exe and how about the other stuff
Re: HELP! Download thing
Posted: Sun Feb 21, 2010 10:20 pm
by Scottie1972
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.
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