Adblock breaks this site

[Tut] File Download -- My NameSpace

Discussion in 'Programming General' started by Nirinium, Jan 23, 2009.

Thread Status:
Not open for further replies.
  1. Nirinium

    Nirinium Newcomer

    Joined:
    Jul 24, 2006
    Posts:
    9
    Referrals:
    0
    Sythe Gold:
    0
    [Tut] File Download -- My NameSpace

    This is a tutorial on file downloading using the My Namespace.

    You Need:
    1 TextBox (For The File URL)
    1 Button (To Download The File)

    Okay let's get started.

    Button Code:
    Code:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim address, file As String
            address = "Your Filepath Here like C:\YourProgram\File.txt""
            file = TextBox1.Text
            My.Computer.Network.DownloadFile(file, address)
    End Sub
    
    Now I will break this code down for you. (probably not very good as I am still learning vb.net..)


    This line of code controls the events of Button1 being clicked.
    Code:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    
    This line sets the words "address" and "file" as strings.
    Code:
     Dim address, file As String
    This line controls the function of the word "address".
    Code:
    address = "Your Filepath Here like C:\YourProgram\File.txt"
    This line controls the URL to your file in TextBox1.
    Code:
    file = TextBox1.Text
    This line actually controls the download itself using the My Namespace.
    Code:
    My.Computer.Network.DownloadFile(file, address)
    This line ends the sub.
    Code:
    End Sub
    This could be very useful if it could automatically detect what kind of filetype the URL is.. If anyone can help me with that, it would make this a lot more efficient.

    This is my first tutorial so.. don't be too hard on me please? Thanks for reading. - Nirinium.
     
  2. Swan

    Swan When They Cry...
    Retired Global Moderator

    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner
    [Tut] File Download -- My NameSpace

    Not a very good tutorial; You hardly explained anything in depth but rather just threw code and loosely explained what it does, not how it works.

    Furthermore, why are you writing a tutorial when you're still in the process of learning? Doesn't make much sense.
     
  3. Nirinium

    Nirinium Newcomer

    Joined:
    Jul 24, 2006
    Posts:
    9
    Referrals:
    0
    Sythe Gold:
    0
    [Tut] File Download -- My NameSpace

    Well sorry for livin', Calm down dude; Maybe help me instead of flame me? Thanks?
     
  4. drainingpower

    drainingpower Guru

    Joined:
    Jan 15, 2008
    Posts:
    1,166
    Referrals:
    0
    Sythe Gold:
    0
    [Tut] File Download -- My NameSpace

    hey, i think your tutorial is pretty good, you can also use the webclient function to download files as well. :)
     
  5. Swan

    Swan When They Cry...
    Retired Global Moderator

    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner
    [Tut] File Download -- My NameSpace

    I wasn't flaming, it just isn't good. I stated what I believe is the truth, do you have a problem with it?

    The point of a tutorial is to help people learn - Nothing is learned from this particular "tutorial", it just teaches them how to copy and paste.

    /edit/: Drainingpower, WebClient is a class, not a function.
     
  6. war833

    war833 Member

    Joined:
    Dec 11, 2008
    Posts:
    82
    Referrals:
    0
    Sythe Gold:
    0
    [Tut] File Download -- My NameSpace

    Judging by those explanations, he probably copied and pasted it from somewhere else and barely understands what the code means himself.
     
  7. Nirinium

    Nirinium Newcomer

    Joined:
    Jul 24, 2006
    Posts:
    9
    Referrals:
    0
    Sythe Gold:
    0
    [Tut] File Download -- My NameSpace

    Your a moron.
     
  8. Swan

    Swan When They Cry...
    Retired Global Moderator

    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner
    [Tut] File Download -- My NameSpace

    *sighs* I have nothing against you Nirinium, but pointlessly insulting people after they say something like that isn't going to help the situation - if anything it will get YOU an infraction.

    Closed.
     
< Making a runescape Client | Turns monitor off then back on.. >
Thread Status:
Not open for further replies.


 
 
Adblock breaks this site