FTP 서버의 모든 디렉토리 목록을 가져와야 할 때 상황을 처리 할 수있는 방법이 있습니까? 디렉토리 수는 너무 커서 가져 오기에는 시간이 오래 걸리고 작업이 시간 초과로 실패합니다.ftp 디렉토리 목록 제한 시간. 엄청난 수의 하위 디렉토리
어떻게 든 할 수있는 라이브러리가 있는지 궁금합니다.
FTP 서버의 모든 디렉토리 목록을 가져와야 할 때 상황을 처리 할 수있는 방법이 있습니까? 디렉토리 수는 너무 커서 가져 오기에는 시간이 오래 걸리고 작업이 시간 초과로 실패합니다.ftp 디렉토리 목록 제한 시간. 엄청난 수의 하위 디렉토리
어떻게 든 할 수있는 라이브러리가 있는지 궁금합니다.
는 처음 5 레벨을 찾을 수
FtpWebRequest ftpRequest = (FtpWebRequest)WebRequest.Create(uri);
ftpRequest.Credentials = new NetworkCredential("anonymous","[email protected]");//replace with your Creds
ftpRequest.Method = WebRequestMethods.Ftp.ListDirectory;
FtpWebResponse response = (FtpWebResponse)ftpRequest.GetResponse();
StreamReader streamReader = new StreamReader(response.GetResponseStream());
List<string> directories = new List<string>();
string line = streamReader.ReadLine();
while (!string.IsNullOrEmpty(line))
{
directories.Add(line);
line = streamReader.ReadLine();
}
streamReader.Close();
// also add some code that will Dispose of the StreamReader object
// something like ((IDisposable)streanReader).Dispose();
// Dispose of the List<string> as well
line = null;
당신은 데이터 즉를 제한 할 수 있습니다 이런 식으로 뭔가를 시도하고 LOD 방법을? –
청크로받을 수 있습니까? 'a'로 시작하는 모든 폴더를 말한 다음 'b'등으로 시작하는 다른 검색어를 말하십시오. 다른 방법으로도 검색어를 분리 할 수 있습니다 (예 : 날짜) – Adrian
열쇠는 ListDirectory입니다. 아래 예를 게시했습니다. 당신이 그것을 할 수있는 방법 .. 감사합니다 행복한 금요일 – MethodMan