|
发表于 2009-4-27 14:11:55
|
显示全部楼层
_FileListToArray
Lists files and\or folders in a specified path (Similar to using Dir with the /B Switch)
#Include <File.au3>
_FileListToArray($sPath[, $sFilter = "*"[, $iFlag = 0]])
参数
$sPath | Path to generate filelist for. | $sFilter | Optional the filter to use, default is *. Search the Autoit3 helpfile for the word "WildCards" For details. | $iFlag | Optional: specifies whether to return files folders or both
$iFlag=0(Default) Return both files and folders
$iFlag=1 Return files only
$iFlag=2 Return Folders only |
返回值
@Error: 1 = Path not found or invalid
2 = Invalid $sFilter
3 = Invalid $iFlag
4 = No File(s) Found
注意
The array returned is one-dimensional and is made up as follows:
$array[0] = Number of Files\Folders returned
$array[1] = 1st File\Folder
$array[2] = 2nd File\Folder
$array[3] = 3rd File\Folder
$array[n] = nth File\Folder
#Include <File.au3>
#Include <Array.au3>
$FileList=_FileListToArray(@DesktopDir)
If @Error=1 Then
MsgBox (0,"","No Files\Folders Found.")
Exit
EndIf
_ArrayDisplay($FileList,"$FileList") |
|