本帖最后由 水木子 于 2010-5-5 09:09 编辑 #include <GUIListView.au3>
Opt("TrayMenuMode", 1)
GUICreate("FileFindFirstFile", 400, 300)
$ListView1 = GUICtrlCreateListView('文件', 5, 5, 390, 230)
_GUICtrlListView_SetColumnWidth($ListView1, 0, 380)
$Input1 = GUICtrlCreateInput("", 5, 260, 340, 21)
$But1 = GUICtrlCreateButton("浏览", 350, 258, 40, 25)
GUISetState()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case - 3
Exit
Case $But1
Browse()
EndSwitch
WEnd
Func Browse()
$Path = FileSelectFolder("查找", "C:Windows", "可执行文件(*.ini)")
If Not @error Then
GUICtrlSetData($Input1, $Path)
Read($Path)
EndIf
EndFunc ;==>Browse
Func read($current)
Local $search = FileFindFirstFile($current & "\*.*")
While 1
Dim $file = FileFindNextFile($search)
If @error Or StringLen($file) < 1 Then ExitLoop
If Not StringInStr(FileGetAttrib($current & "" & $file), "D") And ($file <> "." Or $file <> "..") Then
_GUICtrlListView_AddItem($ListView1, $current & "" & $file)
EndIf
If StringInStr(FileGetAttrib($current & "" & $file), "D") And ($file <> "." Or $file <> "..") Then
read($current & "" & $file)
EndIf
WEnd
Return
EndFunc ;==>read
|