Dart.Ftp Namespace > Ftp Class : ListDirectoryTree Method |
Public Function ListDirectoryTree( _ ByVal remoteRoot As String, _ ByVal pattern As String, _ ByVal excludeEmptyDirs As Boolean _ ) As List(Of ListEntry)
Dim instance As Ftp Dim remoteRoot As String Dim pattern As String Dim excludeEmptyDirs As Boolean Dim value As List(Of ListEntry) value = instance.ListDirectoryTree(remoteRoot, pattern, excludeEmptyDirs)
public List<ListEntry> ListDirectoryTree( string remoteRoot, string pattern, bool excludeEmptyDirs )
public: List<ListEntry^>^ ListDirectoryTree( String^ remoteRoot, String^ pattern, bool excludeEmptyDirs )
Exception | Description |
---|---|
System.ArgumentException | pattern is an absolute path (starts with "/"). |
Creates a List of remote files that can be used as a parameter for the Get method.
Empty directories are directories containing no files anywhere within their tree. An empty directory containing an empty directory is considered empty.
If your server returns the timestamp in a non-standard format, or uses non-english month abbreviations, set System.Globalization.DateTimeFormatInfo to the CultureInfo.DateTimeFormat of the appropriate CultureInfo.
DataIsBusy returns true while this method executes.
public void getMultipleFiles() { //Retrieve a list of txt files to transfer. List<ListEntry> filesToGet = ftp1.ListDirectoryTree("MyTextFiles", "*.txt", true); //Tailor the list to not include a specific file. foreach (ListEntry entry in filesToGet) { if (entry.Name == "not_me.txt") { filesToGet.Remove(entry); break; } } //Retrieve the files. string workingDirectory = ftp1.GetDirectory(); ftp1.Get(filesToGet, workingDirectory + "/MyTextFiles", myLocalDirectory, Synchronize.Off); }
Public Sub getMultipleFiles() 'Retrieve a list of txt files to transfer. Dim filesToGet As List(Of ListEntry) = ftp1.ListDirectoryTree("MyTextFiles", "*.txt", True) 'Tailor the list to not include a specific file. For Each entry As ListEntry In filesToGet If entry.Name = "not_me.txt" Then filesToGet.Remove(entry) Exit For End If Next entry 'Retrieve the files. Dim workingDirectory As String = ftp1.GetDirectory() ftp1.Get(filesToGet, workingDirectory & "/MyTextFiles", myLocalDirectory, Synchronize.Off) End Sub