public void ListDirectory() { var folderName = string.Empty; var folderList = new List <string>(); var fileList = new List <string>(); var success = _ftpFolder.ListDirectory(out folderList, out fileList, folderName); Assert.IsTrue(success); }
override public void Initialize(string uri) { base.InitializeUri(uri); _ftpFolder = new FTPFolder(_ftpuri.FormatFtpUri(_username, _password)) { PassiveMode = false, IsBubbleUpException = _isDownload }; var strFolderList = new List <string>(); var strFileList = new List <string>(); _ftpFolder.ListDirectory(out strFolderList, out strFileList); strFileList.ForEach(fileName => { var ftpFile = new FTPFile(_ftpuri.FormatFtpUri(_username, _password, fileName)) { PassiveMode = false, IsBubbleUpException = _isDownload }; if (null != TimeOut) { ftpFile.TimeOut = TimeOut; } _ftpFileList.Add(ftpFile); if (_isDownload) { ftpFile.DownloadFile(Path.Combine(LocalFolderRoot, fileName)); } }); strFolderList.ForEach(subfolder => { var subUri = string.Format(@"{0}/{1}", _ftpuri, subfolder); var localFolder = Path.Combine(_localFolderRoot, subfolder); var ftpTreeNode = new FTPTreeNode(subUri, _username, _password, localFolder, IsDownload) { PassiveMode = false, TimeOut = TimeOut }; _ftpTreeNodeList.Add(ftpTreeNode); ftpTreeNode.Initialize(ComposeInitialUriString(subUri, _username, _password)); }); }