-2

I want to download A ftp directory which has its sub directories and files, I am using C# Ftpwebrequst.

4

2 回答 2

1

There is no way to directly download an entire folder in a single command. FTP does not support this. You would need to enumerate through all files in the directory and their subdirectories and download files one-by-one.

Here is a thread from MSDN forums and here is the documentation on FtpWebRequest-class from MSDN.

于 2013-03-22T10:48:01.277 回答
0

I think you need something like this and you will have to recurse into each folder inidividually:

    WebRequest request = WebRequest.Create(FTPServerDirectory);
            request.Method = WebRequestMethods.Ftp.ListDirectory;
            request.Credentials = new NetworkCredential(Username, Password);
            request.GetResponse();
于 2013-03-22T10:47:25.877 回答