找回密码
 加入
搜索
查看: 4451|回复: 9

Autoit如何搜索文件?

[复制链接]
发表于 2009-3-26 12:45:17 | 显示全部楼层 |阅读模式
...RT..
我需要全盤搜索.....
FileFindFirstFile 不能全盤搜索.....
謝謝大蝦咯!
发表于 2009-3-26 12:48:43 | 显示全部楼层
这个可以全盘搜索.可能你用法不当
 楼主| 发表于 2009-3-26 13:21:22 | 显示全部楼层

回复 2# akmm88 的帖子

請指教.....
发表于 2009-3-26 19:13:10 | 显示全部楼层
用枚举,函数区里有
 楼主| 发表于 2009-4-3 10:54:14 | 显示全部楼层
........
我想要看看函數示範而已......另外枚舉是什麽?
发表于 2009-4-3 11:31:48 | 显示全部楼层
可以看下这个例子
http://www.autoitx.com/forum.php?mod=viewthread&tid=6181&extra=page%3D1

[ 本帖最后由 maker 于 2009-4-4 10:53 编辑 ]
发表于 2009-7-29 22:07:34 | 显示全部楼层
ddddddddddd
发表于 2009-7-30 20:14:25 | 显示全部楼层
Func Search($current, $ext)
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
If StringRight($current & "\" & $file, StringLen($ext)) = $ext Then
ConsoleWrite($current & "\" & $file & @CRLF)
EndIf
EndIf
If StringInStr(FileGetAttrib($current & "\" & $file), "D") And ($file <> "." Or $file <> "..") Then
Search($current & "\" & $file, $ext)
EndIf
WEnd
Return
EndFunc ;==>Search
发表于 2009-7-30 20:15:54 | 显示全部楼层
#NoTrayIcon

Opt("MustDeclareVars", 1)
#include <Constants.au3>

Local $Drive, $I, $File

$File = InputBox("输入", "输入要查找的文件名:", "", "", 180, 80, -1, -1)
If @error Or $File = "" Then Exit

$Drive = DriveGetDrive("FIXED")

For $I = 1 To $Drive[0]
        Local $foo, $line, $lines
        $foo = Run(@ComSpec & " /c dir /b /s /a " & $File, $Drive[$I] & "\", @SW_HIDE, $STDOUT_CHILD)
        $lines = ""
        While 1
                $line = StdoutRead($foo)
                If @error Then ExitLoop
                $lines &= $line
        WEnd
        If $lines = "" Then
                MsgBox(16, "错误", "在驱动器" & $Drive[$I] & "没有找到要找的文件!", 2)
                ContinueLoop 1
        EndIf
        MsgBox(0, "找到的文件:", $lines)
Next
发表于 2009-7-30 20:16:26 | 显示全部楼层
实现方法好多哦,自己搜索一下吧
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-22 23:36 , Processed in 0.076440 second(s), 22 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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