找回密码
 加入
搜索
查看: 2003|回复: 1

查找文件问题

[复制链接]
发表于 2008-6-20 21:50:20 | 显示全部楼层 |阅读模式
;查找脚本目录的ISO文件
    Local $search = FileFindFirstFile("*.iso")
If $search = -1 Then
   MsgBox(64, "错误", "当前目录没有可用的.iso文件",5)
 Exit
EndIf
 While 1
    Local $sfile = FileFindNextFile($search)
Global $sFilename = @ScriptDir & "\" & $sfile  ;默认显示内容
MsgBox ( 4096 , "test" ,$sFilename)
 If $search = 1  Then ExitLoop
    If @error Then ExitLoop
 WEnd
 FileClose($search); 关闭搜索句柄


这个代码是查找脚本目录的ISO文件,它会将ISO一个一个显示出来,我想修改下功能,就是查找到第一个ISO就停止搜索,请问如何修改下

[ 本帖最后由 telking 于 2008-6-20 22:02 编辑 ]
发表于 2008-6-20 22:26:18 | 显示全部楼层
[au3];查找脚本目录的ISO文件
    Local $search = FileFindFirstFile("*.iso")
If $search = -1 Then
   MsgBox(64, "错误", "当前目录没有可用的.iso文件",5)
Exit
EndIf
While 1
    Local $sfile = FileFindNextFile($search)
Global $sFilename = @ScriptDir & "\" & $sfile  ;默认显示内容
MsgBox ( 4096 , "test" ,$sFilename)
If $search = 1  Then ExitLoop
    If @error Then ExitLoop
exitloop
WEnd
FileClose($search); 关闭搜索句柄[/au3]
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-26 12:02 , Processed in 0.078760 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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