FtpWebRequest ListDirectory截断为10,000个文件

时间:2013-04-01 20:20:17

标签: .net ftp ftpwebrequest ftpwebresponse

我正在尝试获取FTP目录列表。我的文件夹中有超过10,000个文件,似乎我收到的列表被截断为10,000个文件。有什么我可以做的,以便我可以取回所有文件吗?

FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://mysite.com");
request.Method = WebRequestMethods.Ftp.ListDirectory;

request.Credentials = myCache;
FtpWebResponse response = (FtpWebResponse)request.GetResponse();

Stream responseStream = response.GetResponseStream();
StreamReader reader = new StreamReader(responseStream);
string Datastring = reader.ReadToEnd();

string[] myfiles = Datastring.Split(new string[] { Environment.NewLine },
    StringSplitOptions.RemoveEmptyEntries);

0 个答案:

没有答案