tu0129 发表于 2013-5-12 17:50:34

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

本帖最后由 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)

zch11230 发表于 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))

lxz 发表于 2013-5-12 21:43:25

不错的代码.

tu0129 发表于 2013-5-12 23:12:33

回复 2# zch11230



加上搜索的代码后假如搜索到三个符合条件的文件,只能列出一个来啊
页: [1]
查看完整版本: 使用FileFindFirstFile搜索到的文件,如何如何通过列表或者GUI把它按修改时间列出来