將ListDirectory
發送到FTP服務器,但僅返回來自FTP的前2000個項目。添加SSL不會返回更多結果。WebRequestMethods.Ftp.ListDirectory結果僅限於2000個條目
是否有另一個圖書館我應該用來獲得完整的結果?
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(OnValidateCertificate);
ServicePointManager.Expect100Continue = true;
FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://XXXX");
request.Method = WebRequestMethods.Ftp.ListDirectory;
request.Credentials = new NetworkCredential("User", "Password");
request.EnableSsl = true;
ServicePoint sp = request.ServicePoint;
Console.WriteLine("ServicePoint connections = {0}.", sp.ConnectionLimit);
sp.ConnectionLimit = 1;
using (var response = (FtpWebResponse)request.GetResponse())
{
using (var stream = response.GetResponseStream())
{
using (var reader = new StreamReader(stream, true))
{
string line = reader.ReadLine();
while (line != null)
{
ListFiles.Add(line);
line = reader.ReadLine();
}
}
}
}
它是託管服務無法更新的服務器上的全局設置。但我可以ssh獲得名單。 – juanvan
你可以改變你的目錄結構,這樣個人目錄中的文件少於2000個嗎? – EJoshuaS