找回密码
 加入
搜索
查看: 2050|回复: 3

文件查找问题

[复制链接]
发表于 2008-8-17 20:02:08 | 显示全部楼层 |阅读模式
各位大侠,请问如何在指定文件夹查找文件,最后把光标停留在所查找的文件上?

[ 本帖最后由 allen9158 于 2008-8-18 15:42 编辑 ]
发表于 2008-8-17 23:44:01 | 显示全部楼层
不知这样行不行?
_filelist("c:\windows", "notepad.exe")
Func _filelist($searchdir, $tmp)
        $search = FileFindFirstFile($searchdir & "\*.*")
        If $search = -1 Then Return -1
        While 1
                $file = FileFindNextFile($search)
                If @error Then
                        FileClose($search)
                        Return -1
                ElseIf $file = "." Or $file = ".." Then
                        ContinueLoop
                ElseIf StringInStr(FileGetAttrib($searchdir & "\" & $file), "D") Then
                        _filelist($searchdir & "\" & $file, $tmp)
                EndIf
                If $file = $tmp Then
                        ShellExecute($searchdir)
;~                  WinWait($searchdir)
                        Sleep(500)
                        Send($tmp)
                        ;FileWriteLine(@ScriptDir&"\file.txt", $searchdir & "\" & $file & @CRLF)
                EndIf
        WEnd
EndFunc   ;==>_filelist

评分

参与人数 2金钱 +4 收起 理由
allen9158 + 2 我很赞同
redapple2008 + 2 我很赞同

查看全部评分

发表于 2011-5-27 18:06:29 | 显示全部楼层
留名 收藏
发表于 2011-5-27 18:17:47 | 显示全部楼层
留名 收藏  
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-10-2 03:31 , Processed in 0.126844 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表