0

我正在尝试获取 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);
4

0 回答 0