Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
Get File Information using ListPattern
Demonstrates how to get information about remote files using ListPattern.
set ftp = CreateObject("Chilkat.Ftp2")
ftp.UnlockComponent "any string begins the 30-day trial"
ftp.Username = "***"
ftp.Password = "***"
ftp.Hostname = "ftp.***.com"
ok = ftp.Connect()
if (ok <> 1) then
MsgBox ftp.LastErrorText
end if
' Get information about all ASP files in the
' current remote directory.
ftp.ListPattern = "*.asp"
' How many ASP files exist?
numAspFiles = ftp.NumFilesAndDirs
MsgBox "Number of ASP files = " & ftp.NumFilesAndDirs
' Loop over each file and display information.
for i = 0 to numAspFiles-1
infoStr = ""
' Get the filename
infoStr = infoStr & ftp.GetFilename(i) & vbCrLf
' Get the file size in bytes.
infoStr = infoStr & ftp.GetSize(i) & vbCrLf
' Get the last modified date/time
infoStr = infoStr & ftp.GetLastModifiedTime(i) & vbCrLf
' Get the create date/time
infoStr = infoStr & ftp.GetCreateTime(i) & vbCrLf
' Get the last access date/time
infoStr = infoStr & ftp.GetLastAccessTime(i) & vbCrLf
MsgBox infoStr
next
|
© 2000-2010 Chilkat Software, Inc. All Rights Reserved.