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

debasisdas commented: @'!? -3

Recommended Answers

All 2 Replies

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.



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")

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.