(VB.NET) Transition from SFtp.ReadDir to SFtp.ReadDirListing
Provides instructions for replacing deprecated ReadDir method calls with ReadDirListing. Note: This example requires Chilkat v11.0.0 or greater.
Dim success As Boolean = False
Dim sftp As New Chilkat.SFtp
' ...
' ...
' ------------------------------------------------------------------------
' The ReadDir method is deprecated:
Dim dirObj As Chilkat.SFtpDir = sftp.ReadDir()
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(dirOut)
If (success = False) Then
Debug.WriteLine(sftp.LastErrorText)
Exit Sub
End If
|