[Tut] File Download -- My NameSpace

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

Thread Status:
Not open for further replies.
[Tut] File Download -- My NameSpace
  1. Unread #1 - Jan 23, 2009 at 2:30 PM
  2. Nirinium
    Joined:
    Jul 24, 2006
    Posts:
    9
    Referrals:
    0
    Sythe Gold:
    0

    Nirinium Newcomer

    [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.
     
  3. Unread #2 - Jan 23, 2009 at 10:58 PM
  4. Swan
    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner

    Swan When They Cry...
    Retired Global Moderator

    [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.
     
  5. Unread #3 - Jan 23, 2009 at 11:35 PM
  6. Nirinium
    Joined:
    Jul 24, 2006
    Posts:
    9
    Referrals:
    0
    Sythe Gold:
    0

    Nirinium Newcomer

    [Tut] File Download -- My NameSpace

    Well sorry for livin', Calm down dude; Maybe help me instead of flame me? Thanks?
     
  7. Unread #4 - Jan 24, 2009 at 12:18 AM
  8. drainingpower
    Joined:
    Jan 15, 2008
    Posts:
    1,166
    Referrals:
    0
    Sythe Gold:
    0

    drainingpower Guru

    [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. :)
     
  9. Unread #5 - Jan 24, 2009 at 2:00 AM
  10. Swan
    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner

    Swan When They Cry...
    Retired Global Moderator

    [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.
     
  11. Unread #6 - Jan 24, 2009 at 5:00 AM
  12. war833
    Joined:
    Dec 11, 2008
    Posts:
    82
    Referrals:
    0
    Sythe Gold:
    0

    war833 Member

    [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.
     
  13. Unread #7 - Jan 24, 2009 at 12:07 PM
  14. Nirinium
    Joined:
    Jul 24, 2006
    Posts:
    9
    Referrals:
    0
    Sythe Gold:
    0

    Nirinium Newcomer

    [Tut] File Download -- My NameSpace

    Your a moron.
     
  15. Unread #8 - Jan 24, 2009 at 6:27 PM
  16. Swan
    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner

    Swan When They Cry...
    Retired Global Moderator

    [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.. >

Users viewing this thread
1 guest
Thread Status:
Not open for further replies.


 
 
Adblock breaks this site