![]()  | 
  
Chilkat  HOME  Android™  AutoIt  C  C#  C++  Chilkat2-Python  CkPython  Classic ASP  DataFlex  Delphi DLL  Go  Java  Node.js  Objective-C  PHP Extension  Perl  PowerBuilder  PowerShell  PureBasic  Ruby  SQL Server  Swift  Tcl  Unicode C  Unicode C++  VB.NET  VBScript  Visual Basic 6.0  Visual FoxPro  Xojo Plugin
 
      (Visual FoxPro) Delete Files Matching PatternThe DeleteMatching method deletes all files in the current remote directory matching a wildcarded filename. 
 LOCAL loFtp LOCAL lnSuccess LOCAL lnNumDeleted * This example requires the Chilkat API to have been previously unlocked. * See Global Unlock Sample for sample code. * For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.Ftp2') loFtp = CreateObject('Chilkat.Ftp2') loFtp.Hostname = "www.chilkatsoft.com" loFtp.Username = "MyLogin" loFtp.Password = "MyPassword" * Connect and login to the FTP server. lnSuccess = loFtp.Connect() IF (lnSuccess <> 1) THEN ? loFtp.LastErrorText RELEASE loFtp CANCEL ENDIF * Change to the remote directory where the files to be deleted are located. * for the FTP account. lnSuccess = loFtp.ChangeRemoteDir("junk") IF (lnSuccess <> 1) THEN ? loFtp.LastErrorText RELEASE loFtp CANCEL ENDIF * Delete all files with filenames matching "ftp_*.asp" lnNumDeleted = loFtp.DeleteMatching("ftp_*.asp") IF (lnNumDeleted < 0) THEN ? loFtp.LastErrorText RELEASE loFtp CANCEL ENDIF lnSuccess = loFtp.Disconnect() ? STR(lnNumDeleted) + " Files Deleted!" RELEASE loFtp  | 
  ||||
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.