0

What code would i need to use in order to download a file from a webserver and then save it to a predefined folder?
Then if a newer version of the file is available, Rename the old file and download the new one.

Thansk for the help

Edited by Stealthbird97

3
Contributors
2
Replies
4
Views
5 Years
Discussion Span
Last Post by Maligui
0

to download from ftp you can use this

my.computer.network.download(ur ftp address+filename,username,password,destination folder+filename)
'as i just typed it here so may be the sequence of parameters may be different. so please advance sorry for this.

Regards

0

There are a couple ways of downloading. One is to use the method above. Or, you can use the WebClient component.

' Rename a file

' check if file exist
If System.IO.File.Exists("MyFileName") Then
    ' move the file (rename)
    ' there is no "Rename" in .NET
    ' move actually renames he file.
    System.IO.File.Move("MyFileName", "MyOldFileName")
End If

' Now that we have the file renamed. Download the new file.
Dim WebClient As New System.Net.WebClient
WebClient.DownloadFile("MyAddress/MyFilename", "MyFileName")
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.