This is an old revision of the document!
Session.EnumerateRemoteFiles Method
Recursively enumerates remote files.
Syntax
C#
public IEnumerable<RemoteFileInfo> EnumerateRemoteFiles(string path, string mask, EnumerationOptions options)
VB.NET
Public Function EnumerateFiles(ByVal path As String, ByVal mask As String, ByVal options As EnumerationOptions) As IEnumerable(Of RemoteFileInfo)
===== Level 1 Headline
=== Level 3 Headline
[[http://www.example.com|External Link]]
====
=
Exceptions
Exception | Condition |
---|---|
InvalidOperationException | Session is not opened. |
ArgumentException | Invalid combination of options . |
SessionLocalException | Error communicating with winscp.com . See the exception documentation for details. |
SessionRemoteException | Session has failed. Enumeration of files has failed. See the exception documentation for details. |
TimeoutException | Timeout waiting for winscp.com to respond. |
Remarks
References to this directory (.
) and parent directory (..
) are never enumerated.
Use RemoteFileInfo.FullName
to retrieve a full path to the enumerated file or directory.
Errors, when listing subfolders, are silently ignored. You can use the Session.Failed
event to capture these errors.