#include <File.au3>
#include <GuiListBox.au3>
GUICreate('', 400, 300)
$List1 = GUICtrlCreateList('', 5, 5, 390, 260)
$Input1 = GUICtrlCreateInput('', 5, 270, 320, 21)
$But1 = GUICtrlCreateButton('浏览', 325, 268, 70, 25)
GUISetState()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
Exit
Case $But1
$var = FileSelectFolder('选择一个文件夹.', '')
If StringRegExp($var, '(?i)^[a-z]:\\') Then
GUICtrlSetData($Input1, $var)
$var = StringRegExpReplace($var, '\\$', '')
_GUICtrlListBox_ResetContent($List1)
_FindFile($var)
EndIf
EndSwitch
WEnd
Func _FindFile($sFilePath)
$aFileList = _FileListToArray($sFilePath)
If Not @error Then
For $i = 1 To $aFileList[0]
GUICtrlSetData($List1, $sFilePath & '\' & $aFileList[$i])
_FindFile($sFilePath & '\' & $aFileList[$i])
Next
EndIf
EndFunc ;==>_FindFile
|