Sample code for 30+ languages & platforms
Visual Basic 6.0 Requires Chilkat v11.0.0+

Transition from SFtp.ReadDir to SFtp.ReadDirListing

Provides instructions for replacing deprecated ReadDir method calls with ReadDirListing.

Chilkat Visual Basic 6.0 Downloads

Visual Basic 6.0
Dim success As Long
success = 0

Dim sftp As New ChilkatSFtp

'  ...
'  ...

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

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

Dim dirObj As ChilkatSFtpDir
Set dirObj = sftp.ReadDir(handle)
If (sftp.LastMethodSuccess = 0) Then
    Debug.Print 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 ChilkatSFtpDir
success = sftp.ReadDirListing(handle,dirOut)
If (success = 0) Then
    Debug.Print sftp.LastErrorText
    Exit Sub
End If

'  ...
'  ...

success = sftp.CloseHandle(handle)