Nirinium
Newcomer
- Joined
- Jul 24, 2006
- Sythe Gold
- 0
- Messages
- 9
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:
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.
This line sets the words "address" and "file" as strings.
This line controls the function of the word "address".
This line controls the URL to your file in TextBox1.
This line actually controls the download itself using the My Namespace.
This line ends the 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.
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.




