views:

28

answers:

3

On the WebClient page i see the following

By default, the .NET Framework supports URIs that begin with http:, https:, ftp:, and file: scheme identifiers.

The FTP i am using requires a login. How do i login with WebClient to download a file?

A: 

Try setting the Credentials property of the WebClient to your FTP username and password.

Chris
A: 

You'll need to pass in Credentials.

drharris
+1  A: 

You need to set the credentials on the WebClient object, e.g.

Dim ftpReq As FtpWebRequest = WebRequest.Create(filename)
ftpReq.Method = WebRequestMethods.Ftp.DownloadFile
ftpReq.Credentials = New NetworkCredential("anonymous", "password")

See here.

Will A