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

[AU3基础] 使用FileFindFirstFile搜索到的文件,如何如何通过列表或者GUI把它按修改时间列出来

[复制链接]
发表于 2013-5-12 17:50:34 | 显示全部楼层 |阅读模式
本帖最后由 tu0129 于 2013-5-12 17:51 编辑

使用FileFindFirstFile搜索到了同一个文件夹下三个文件名称一样的文件,如何通过列表或者GUI按修改时间把它列出来(我想要的效果就像最后那张图)

文件名成为:COM_ATT_130506092649_Pass_2013_05_09_09_30_28.csv
#Include <File.au3>


Local $hSearch = FileFindFirstFile("*130506092649*")


If $hSearch = -1 Then
        MsgBox(4096, "错误", "没有文件/目录 匹配搜索")
        Exit
EndIf

While 1
        Local $sFile = FileFindNextFile($hSearch)
        If @error Then ExitLoop

        MsgBox(0, "", $sFile)
WEnd

; 关闭搜索句柄
FileClose($hSearch)

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2013-5-12 19:07:27 | 显示全部楼层
本帖最后由 zch11230 于 2013-5-12 19:09 编辑

要排序的话直接用 dir /b /od 还更方便点。。
#include <Constants.au3>
#include <array.au3>
Local $path = "D:\MyAu3\*.au3"
$run = Run(@ComSpec & ' /c dir /b /od ' & $path, @ScriptDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
ProcessWaitClose($run)
$list = StdoutRead($run)
MsgBox(0, "", $list)
$array=StringRegExp($list,"\V+\v",3)
_ArrayDisplay($array,UBound($array))
发表于 2013-5-12 21:43:25 | 显示全部楼层
不错的代码.
 楼主| 发表于 2013-5-12 23:12:33 | 显示全部楼层
回复 2# zch11230



加上搜索的代码后假如搜索到三个符合条件的文件,只能列出一个来啊
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-3-28 18:59 , Processed in 0.080515 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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