Sample code for 30+ languages & platforms
VB.NET Requires Chilkat v11.0.0+

Transition from SFtp.ReadDir to SFtp.ReadDirListing

Provides instructions for replacing deprecated ReadDir method calls with ReadDirListing.

Chilkat VB.NET Downloads

VB.NET
Dim success As Boolean = False

Dim sftp As New Chilkat.SFtp

'  ...
'  ...

Dim handle As String = sftp.OpenDir(".")
'  ...
'  ...

'  ------------------------------------------------------------------------
'  The ReadDir method is deprecated:

Dim dirObj As Chilkat.SFtpDir = sftp.ReadDir(handle)
If (sftp.LastMethodSuccess = False) Then
    Debug.WriteLine(sftp.LastErrorText)
    Exit Sub
End If


'  ...
'  ...



'  ------------------------------------------------------------------------
'  Do the equivalent using ReadDirListing.
'  Your application creates a new, empty SFtpDir object which is passed 
'  in the last argument and filled upon success.

Dim dirOut As New Chilkat.SFtpDir
success = sftp.ReadDirListing(handle,dirOut)
If (success = False) Then
    Debug.WriteLine(sftp.LastErrorText)
    Exit Sub
End If


'  ...
'  ...

sftp.CloseHandle(handle)