Results 1 to 2 of 2

Thread: A few Visual Basic questions

  1. #1
    Join Date
    Aug 2009
    Location
    utf-8
    Posts
    205
    Thanks
    4
    Thanked 7 Times in 7 Posts

    Default A few Visual Basic questions

    So I have a button (Button1) that I am trying to get to download a URL from a text box (TextBox1). Any way of programming this?
    Basically the user puts a URL to a file (preferably a .7z archive) inside TextBox1 and when Button1 gets clicked the file will download
    An inline div is a freak of the web and should be beaten until it becomes a span

  2. #2
    Join Date
    Mar 2011
    Posts
    2,144
    Thanks
    59
    Thanked 116 Times in 113 Posts
    Blog Entries
    4

    Default

    Its been a while since I've used VB.net, but check out this link that explains the DownloadFile method.

    The only other things you need to do are to call it within the event for the button and supply it with the value of TextBox1.

    Something like
    Code:
    Public Class Form1
    
        Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
            Dim _WebClient As New System.Net.WebClient()
            _WebClient.DownloadFile(TextBox1.Text, "Path_To_Save_As\filename.file_extension")
        End Sub
    
    End Class
    ?
    Last edited by keyboard; 12-13-2013 at 10:29 AM.

  3. The Following User Says Thank You to keyboard For This Useful Post:

    juliet1 (12-23-2013)

Similar Threads

  1. Visual Basic Act On Key Pressed?
    By Demonicman in forum Other
    Replies: 3
    Last Post: 05-14-2008, 02:26 AM
  2. Visual basic problems
    By ladyjade in forum Other
    Replies: 1
    Last Post: 03-28-2008, 07:35 PM
  3. Visual Basic web browser w. tabs
    By Master_script_maker in forum Other
    Replies: 3
    Last Post: 03-16-2008, 10:29 PM
  4. Visual Basic Script
    By xAidanx in forum Other
    Replies: 2
    Last Post: 06-13-2007, 10:28 PM
  5. MS Visual Basic Express 2005 (ListView help)
    By benslayton in forum Other
    Replies: 0
    Last Post: 12-30-2006, 02:22 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •