Retrieving a local directory listing |
To get a local directory listing of your current local directory use the Sftp.GetLocalDirListing method. This returns a System.Collections.IEnumerator of System.IO.FileSystemInfo objects.
Example
[C#]
// get local directory listing
IEnumerator localResults = sftp.GetLocalDirListing();
// enumerate thru items printing filename for each
while(localResults.MoveNext()) {
System.IO.FileSystemInfo file = (System.IO.FileSystemInfo)localResults.Current;
Console.WriteLine(file.FullName);
}
[VB]
' get local directory listing
Dim localResults As IEnumerator = sftp.GetLocalDirListing
' enumerate thru items printing filename for each
While localResults.MoveNext
Dim file As System.IO.FileSystemInfo = CType(localResults.Current, System.IO.FileSystemInfo)
Console.WriteLine(file.FullName)
End While