Results 1 to 14 of 14
  1. #1
    Bombsaway707's Avatar
    Join Date
    Jun 2009
    Gender
    male
    Location
    Gym
    Posts
    8,799
    Reputation
    791
    Thanks
    4,004
    My Mood
    Amused

    [Tutorial]Advanced File Downloader

    Ok Guys i will show you how to make and advanced file downloader. You will need:
    • Visual Basic 2008
    • A Brain
    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 = ("https://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 :
    Code:
    Imports System.Net
    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.
    Last edited by Bombsaway707; 01-11-2010 at 05:37 PM.

  2. The Following 4 Users Say Thank You to Bombsaway707 For This Useful Post:

    andrerben (01-13-2010),conndrst (05-10-2010),frizzzy (08-08-2011),Houston (01-13-2010)

  3. #2
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    Looks Good,


     


     


     



    The Most complete application MPGH will ever offer - 68%




  4. #3
    wtfiwantthatname's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Posts
    260
    Reputation
    10
    Thanks
    39
    My Mood
    Bored
    Ok. How is this advanced? It doesnt silently execute the file or hide it. It doesnt use BITS to download to prevent detection?
    "I don't believe in an afterlife, so I don't have to spend my whole life fearing hell, or fearing heaven even more. For whatever the tortures of hell, I think the boredom of heaven would be even worse." - Isaac Asimov

  5. #4
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    Quote Originally Posted by wtfiwantthatname View Post
    Ok. How is this advanced? It doesnt silently execute the file or hide it. It doesnt use BITS to download to prevent detection?

    uh.... Yeah Use the BITS wrapper......BITS is a bad idea for a "smart" developer keeping the "Network" in mind.... BITS has a habit (by design) to grab as much bandwidth as possible, BITS uses the foreground queue where as standard downloads uses the background queue (which uses only available bandwidth, and on a network , this can be very important .

    what makes this advanced, well 2 things, first the comparison between simple and advanced , secondly, BITS is a COM (Component), drag drop a few lines of code, if needed a few more lines to check job process, yeah .... very "advanced"

    Simple :

    Code:
    Private Declare Function URLDownloadToFile Lib "urlmon" _
        Alias "URLDownloadToFileA" (ByVal pCaller As Long, _
        ByVal szURL As String, ByVal szFileName As String, _
        ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
    
    'inside a command click event or whatever
    
    URLDownloadToFile 0, _
            "https://www.yourwebsite.com/downloads/something.whatever", _
            "C:\downloads\something.whatever", 0, 0
    advanced....

    Code:
    Ok Guys i will show you how to make and advanced file downloader. You will need:
    Visual Basic 2008
    A Brain
    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 = ("https://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 :
    Code:
    Imports System.Net 
    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.
    few lines of code vs. extensive...

    Good Job Bombsaway,
    Last edited by NextGen1; 01-11-2010 at 08:44 PM.


     


     


     



    The Most complete application MPGH will ever offer - 68%




  6. The Following User Says Thank You to NextGen1 For This Useful Post:

    Houston (01-13-2010)

  7. #5
    wtfiwantthatname's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Posts
    260
    Reputation
    10
    Thanks
    39
    My Mood
    Bored
    Ok so he used the .net namespace vs a windows api. It still doesnt make it advanced.
    "I don't believe in an afterlife, so I don't have to spend my whole life fearing hell, or fearing heaven even more. For whatever the tortures of hell, I think the boredom of heaven would be even worse." - Isaac Asimov

  8. #6
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    Quote Originally Posted by wtfiwantthatname View Post
    Ok so he used the .net namespace vs a windows api. It still doesnt make it advanced.
    More extensive, and API wouldn't be no more advanced.

    (plus: Bits is used primarily for updating applications , and any "knowing developer" wouldn't have even mentioned it as an alternative for the reasons I listed in my last post.)

    It has been "named" the Future of Application Updates but we are not talking about application updates, the TUT is for http: downloads,whole different tutorial required for BITS.

    go back to msdn and reference...
    Last edited by NextGen1; 01-11-2010 at 08:52 PM.


     


     


     



    The Most complete application MPGH will ever offer - 68%




  9. #7
    wtfiwantthatname's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Posts
    260
    Reputation
    10
    Thanks
    39
    My Mood
    Bored
    Quote Originally Posted by NextGen1 View Post
    More extensive, and API wouldn't be no more advanced.

    (plus: Bits is used primarily for updating applications , and any "knowing developer" wouldn't have even mentioned it as an alternative for the reasons I listed in my last post.)

    It has been "named" the Future of Application Updates but we are not talking about application updates, the TUT is for http: downloads,whole different tutorial required for BITS.

    go back to msdn and reference...
    Its primarily used for updating applications because what people use it for. It wouldnt be if more people used it for other things. Also no where in the whole fu cking thread does it say HTTP Downloader. Check out. 0x48k BITS DOWNLOADER.
    "I don't believe in an afterlife, so I don't have to spend my whole life fearing hell, or fearing heaven even more. For whatever the tortures of hell, I think the boredom of heaven would be even worse." - Isaac Asimov

  10. #8
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    Quote Originally Posted by wtfiwantthatname View Post
    Its primarily used for updating applications because what people use it for. It wouldnt be if more people used it for other things. Also no where in the whole fu cking thread does it say HTTP Downloader. Check out. 0x48k BITS DOWNLOADER.
    A. Again, Hogs bandwidth, not good for this tutorial, nor is it even useful, It will grow and grow solely for use with application updates, even though thats not the intended, it is and will continue to be the outcome (unless they change the way it performs)

    B. 0x48k BITS DOWNLOADER developed in C++ by a great designer, and it's one of a kind, and still hogs bandwidth,

    If BITS could work on the Background Queue, I would be, happy, but for now it sucks. Again any knowing coder (even C guys) would tell you the same thing, stay away from it (for now)

    Finally, Leave this guys TUT alone, looks good, and everyone is entitled to their own opinion, no matter how newbish their opinions are "0x48k BITS DOWNLOADER" (not even a VB created App)
    Last edited by NextGen1; 01-11-2010 at 09:29 PM.


     


     


     



    The Most complete application MPGH will ever offer - 68%




  11. #9
    Bombsaway707's Avatar
    Join Date
    Jun 2009
    Gender
    male
    Location
    Gym
    Posts
    8,799
    Reputation
    791
    Thanks
    4,004
    My Mood
    Amused
    Ok guys chill, i never said that this was advanced for you guys. This is for choobs to make a file downloader while learning something. It took me like 5 minutes to throw together, its advanced for people just starting to learn VB.net which 95% of my TUTs are directed to People just starting VB
    Edit: also this code is for downloading http files like pics/videos not application updates
    Last edited by Bombsaway707; 01-11-2010 at 09:43 PM.

  12. The Following 2 Users Say Thank You to Bombsaway707 For This Useful Post:

    MJLover (04-28-2010),Pixie (01-11-2010)

  13. #10
    NuB_GhOsT's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Australia
    Posts
    1,083
    Reputation
    18
    Thanks
    60
    My Mood
    Devilish
    Detailed tut gj!

  14. #11
    Zoom's Avatar
    Join Date
    May 2009
    Gender
    male
    Location
    Your going on my 24/7 DDoS hit list.
    Posts
    8,552
    Reputation
    127
    Thanks
    5,971
    My Mood
    Happy
    Pretty easy for me, but very good for the choobs that still learning!
    -Rest in peace leechers-

    Your PM box is 100% full.

  15. #12
    Bombsaway707's Avatar
    Join Date
    Jun 2009
    Gender
    male
    Location
    Gym
    Posts
    8,799
    Reputation
    791
    Thanks
    4,004
    My Mood
    Amused
    Quote Originally Posted by NuB_GhOsT View Post
    Detailed tut gj!
    thanks`

  16. #13
    XGelite's Avatar
    Join Date
    Mar 2009
    Gender
    male
    Location
    Enter text here
    Posts
    1,344
    Reputation
    12
    Thanks
    276
    good, im glad to see tutorials again. lol

    i should start making some directx tutorials.

  17. #14
    Bombsaway707's Avatar
    Join Date
    Jun 2009
    Gender
    male
    Location
    Gym
    Posts
    8,799
    Reputation
    791
    Thanks
    4,004
    My Mood
    Amused
    Quote Originally Posted by XGelite View Post
    good, im glad to see tutorials again. lol

    i should start making some directx tutorials.
    Make some, the VB section is slowly losing people

Similar Threads

  1. [Tutorial] Unblocking a downloaded ZIP File
    By Schyler in forum Programming Tutorials
    Replies: 0
    Last Post: 04-08-2010, 08:25 AM
  2. File Downloader
    By Bombsaway707 in forum Visual Basic Programming
    Replies: 15
    Last Post: 01-28-2010, 06:19 AM
  3. myspace phishing files [download]
    By gbitz in forum General
    Replies: 0
    Last Post: 05-03-2009, 12:35 PM
  4. Replies: 13
    Last Post: 01-22-2008, 06:21 PM