如何在foxpro中用程序获取目录中的文件列表?
ADIR()-使用任意通配符基于目录创建数组。。。
local array MyFiles[1,5]
nFilesFound = ADIR( MyFiles, "C:Somepath*.dbf" )
for i = 1 to nFilesFound
? "Name Of File: ", MyFiles[ i, 1]
? "Size: ", MyFiles[ i, 2]
*/ i,3 = date... i,4 = time, i,5 = attributes
endfor
您还可以使用文件系统对象来获取更多信息:
fso=createobject("scripting.filesystemobject")
fld=fso.getfolder(lcFolderName)
for each fil in fld.files
?"Name Of File: ", fil.name
?"Size: ", fil.size
?"Date created:", fil.DateCreated
?"Last modified:", fil.DateLastModified
next