-1

i decided to make a download program,
i have a form 2 textboxs n a button, i looks somin like this

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
My.Computer.Network.DownloadFile((TextBox1.Text), (TextBox2.Text))
End Sub

it aint workin cos of
` A valid address should include a protocol, a path and a file name.`

and yes the address is correct how the @'!? do u get it to work

Votes + Comments
@'!?
3
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by Slotes
0

My.Computer.Network.DownloadFile(Address as string, DestinationFileName as string)

Read up and make sure you're assembling the strings properly if this is how you are constructing the statement.

http://msdn2.microsoft.com/en-us/library/ack30t8y(VS.80).aspx

:)

Note how in this example they include a protocol, path, and file name.

My.Computer.Network.DownloadFile _
("http://www.cohowinery.com/downloads/WineList.txt", _
"C:\Documents and Settings\All Users\Documents\WineList.txt")

0

you should change the code to this: it should make it work:

My.Computer.Network.DownloadFile(textbox1.text, "C:\where the file will save to, the C:\ has to be there for it to work")
            Process.Start("C:\same location as where the file will download to, this starts the program after it downloads")

hope that helped you, im also somewhat of a noob when it comes to VB but try that.

Edited by Slotes: Fixing code for direct help

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.