Gets file listing of files matching filter criteria.
Filter is any regular expression supported by the FTP server.
Namespace: Jscape.FtpAssembly: Jscape.Ftp (in Jscape.Ftp.dll) Version: 2.4.5.0
Syntax
C# |
---|
public virtual IEnumerator GetDirListing( string filter ) |
Visual Basic |
---|
Public Overridable Function GetDirListing ( _ filter As String _ ) As IEnumerator |
Visual C++ |
---|
public: virtual IEnumerator^ GetDirListing( String^ filter ) |
Parameters
- filter
- Type: System..::..String
The filename filter.
Return Value
An Enumeration of FtpFile objects.
Remarks
Parsers are included with this release to handle UNIX, NT, and
VMS directory style listings. If you are connecting to a FTP server
that does not use any of these listing formats then you can optionally
develop your own parser by extending the FtpFileParser class, or use
some of the alternative methods for obtaining a directory listing such
as the GetNameListing or GetDirListingAsString methods.
Examples
This example displays a remote directory listing using the GetDirListing enumeration.
CopyC#
Copy

IEnumerator e = myFtp.GetDirListing();
while (e.MoveNext()) {
Console.WriteLine(e.Current);
}

Dim e As IEnumerator = myFtp.GetDirListing() While e.MoveNext() System.Console.WriteLine(e.Current) End While
Exceptions
Exception | Condition |
---|---|
Jscape.Ftp..::..FtpException | If an I/O or FTP error occurs. |