Click here to Skip to main content
Licence 
First Posted 5 Mar 2005
Views 52,182
Bookmarked 21 times

DownloadManager

By | 5 Mar 2005 | Article
a downloadmanager to download files(everey extension) for everyone

Sample Image - DownloadManager.jpg

Introduction

This is an easy Download-application. I#ve just developed it, because I wanted a MP3 download. But with Windows Download, it
didn't work. So I developed that and then it worked.

To the source:
It's really easy. I just needed a 'TextBox', a 'SaveFileDialog' and a 'Button'. First I had to import System.Net.
With this I declared a WebClient. If you click the buttton, the Dialog will be shown. The directory where you first are,
is the directory from where you execute the application. There's no filter, so you've to write the full file-name in the
dialog. When you click then Ok in the SaveFileDialog, the Download begins. If it was sucessfull, a MessageBox will be shown
with a message that says that the download completed. But if an error executed(e.g. because the URL is incorrect) another
MessageBox will be shown, which says that the download was aborted and reports then the error.

Source-Block(everything without the automatic generated code of the designer)

Private Sub Button1_Click_1(ByVal sender As System.Object, _
            ByVal e As System.EventArgs) Handles Button1.Click
        On Error GoTo Err
        Dim dl As New WebClient
        With SaveFileDialog1
            .InitialDirectory = System.Reflection.Assembly. _
                  GetExecutingAssembly.Location
            .Filter = "All Extensions (*.*)|*.*"               'there's no filter
            .FilterIndex = 1
            .RestoreDirectory = True
            If SaveFileDialog1.ShowDialog() = DialogResult.OK Then
                dl.DownloadFile(sourceTxtBox.Text, SaveFileDialog1.FileName) 'download the file(from url in txtbox) to the dir you specified
                MsgBox("Download was sucessfull... " & _
                    "The file was saved in: " & _
                    SaveFileDialog1.FileName, MsgBoxStyle.OKOnly, "Download completed")   'write the dir you specified again in msgBox
            End If
        End With
        Exit Sub

Err:
        MsgBox("There was an error while downloading the file: " & _
           Err.Description, MsgBoxStyle.Critical, _
           "FATAL ERROR!")
    End Sub

Private Sub Button2_Click(ByVal sender As System.Object, _
            ByVal e As System.EventArgs) Handles Button2.Click
        End

End Sub

 

About me:

My favourites (languages) are VB .Net, C++ (managed, not managed and  for some weeks I started to learn hooking ) and HTML. My interests are those languages, tennis, football and maths.

History

Start of developing: Friday, 18th February

End of developing:   Sunday, 20th February

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Merz_Konstantin_FFB

Web Developer

Germany Germany

Member

My hobbies are C++(managed and not manged(i'm a total tiro at this), Visual Basic .Net, Inside Win2k, Tennis and maths.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
QuestionCan i use *.extension for multi file download PinmemberVivek Narayanan3:14 8 Dec '06  
Generalautomatic download of CSV file Pinmemberprakash_21022:00 17 Jul '06  
Question% ? Pinmembermp4city4:09 13 Jan '06  
GeneralContent of downloaded file PinmemberSkipper_XL3:47 21 Oct '05  
GeneralRe: Content of downloaded file PinmemberSkipper_XL3:56 21 Oct '05  
GeneralSeems to work but... PinmemberJavier Injoque16:13 16 Oct '05  
QuestionIs Incomplete? PinmemberRicardo Trapp13:23 6 Mar '05  
AnswerRe: Is Incomplete? PinmemberMerz_Konstantin_FFB8:37 10 Mar '05  
GeneralRe: Is Incomplete? Pinmembertgambee12:38 7 Apr '05  
GeneralRe: Is Incomplete? PinmemberMerz_Konstantin_FFB9:14 10 Apr '05  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120517.1 | Last Updated 6 Mar 2005
Article Copyright 2005 by Merz_Konstantin_FFB
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid