还未解决~再研究
写了一个函数将指定目录下的exe文件写入变量$str中,现想查看并返回包含字符(假设为aa.exe)的行,如何处理?
#include <Timers.au3>
$str=""
$DirName="f:\start"
$ext="*.*"
$starttime = _Timer_Init()
_listview($DirName,$ext)
$time=_Timer_Diff($starttime)
MsgBox(0,$time,$str)
Func _listview($Dir,$ext)
Local $FHandle,$FFileName
If StringRight($Dir, 1) <> '\' Then $Dir = $DirName & '\'
$FHandle = FileFindFirstFile($Dir & $ext)
;~ If $FHandle = -1 Then Return -1
While True
$FFileName = FileFindNextFile($FHandle)
If @error Then ExitLoop
If $FFileName = '.' Or $FFileName = '..' Then ContinueLoop
If StringInStr(FileGetAttrib($Dir & $FFileName), 'D') Then
_listview($Dir & $FFileName & "\","*.exe")
Else
If StringRight($FFileName,3)="exe" Then $str &= $Dir & $FFileName & " "
EndIf
WEnd
FileClose($FFileName)
EndFunc
[ 本帖最后由 stjie 于 2009-1-19 15:52 编辑 ] |