本帖最后由 linkuncool 于 2010-9-8 18:10 编辑
这个令我很头痛#Include <File.au3>
#Include <Array.au3>
For $i = 0 to 10 step 1
DirCreate ("d:\123\$"&$i&"$")
Next
$folderlist=_FileListToArray ("d:\123")
If $folderlist=0 Then
MsgBox (0,"","发生错误")
ElseIf @error = 1 Then
MsgBox (0,"","Path not found or invalid")
ElseIf @error = 2 Then
MsgBox (0,"","Invalid $sFilter")
ElseIf @error = 3 Then
MsgBox (0,"","Invalid $iFlag")
ElseIf @error = 4 Then
MsgBox (0,"","No File(s) Found")
Else
_ArrayDisplay($FolderList,"$FileList")
EndIf
上面的代码 _FileListToArray 不带参数运行 OK#Include <File.au3>
#Include <Array.au3>
For $i = 0 to 10 step 1
DirCreate ("d:\123\$"&$i&"$")
Next
$folderlist=_FileListToArray ("d:\123",2)
If $folderlist=0 Then
MsgBox (0,"","发生错误")
ElseIf @error = 1 Then
MsgBox (0,"","Path not found or invalid")
ElseIf @error = 2 Then
MsgBox (0,"","Invalid $sFilter")
ElseIf @error = 3 Then
MsgBox (0,"","Invalid $iFlag")
ElseIf @error = 4 Then
MsgBox (0,"","No File(s) Found")
Else
_ArrayDisplay($FolderList,"$FileList")
EndIf
我需要返回的是文件夹的列表
参数2 代表 返回文件夹名列表
执行失败#Include <File.au3>
#Include <Array.au3>
For $i = 0 to 10 step 1
DirCreate ("d:\123\$"&$i&"$")
Next
$folderlist=_FileListToArray ("d:\123","",2)
If $folderlist=0 Then
MsgBox (0,"","发生错误")
ElseIf @error = 1 Then
MsgBox (0,"","Path not found or invalid")
ElseIf @error = 2 Then
MsgBox (0,"","Invalid $sFilter")
ElseIf @error = 3 Then
MsgBox (0,"","Invalid $iFlag")
ElseIf @error = 4 Then
MsgBox (0,"","No File(s) Found")
Else
_ArrayDisplay($FolderList,"$FileList")
EndIf
这样也不行
返回以前只是需要文件名的返回值
今天需要文件夹的 昨天晚上就开始调试了
实在不知道为什么
帮助文件里写的清清楚楚啊 |