#include <File.au3>
$txtfile = _FileListToArray("C:\", "*.txt", 1)
If @error Then Exit
If IsArray($txtfile) Then
$lastmodifytime = $txtfile
For $i = 1 To $txtfile[0]
$lastmodifytime[$i] = FileGetTime("C:\" & $txtfile[$i], 0, 1)
Next
$last = $lastmodifytime[1]
$last_index = 1
For $i = 2 To $txtfile[0]
If StringCompare($last, $lastmodifytime[$i])<0 Then
$last = $lastmodifytime[$i]
$last_index = $i
EndIf
Next
MsgBox(0, "文件(带扩展名)", $txtfile[$last_index])
;;;;; $szDrive = ""
;;;;; $szDir = ""
;;;;; $szFName = ""
;;;;; $szExt = ""
;;;;; _PathSplit("C:\" & $txtfile[$last_index], $szDrive, $szDir, $szFName, $szExt)
;;;;; MsgBox(0, "文件(不带扩展名)", $szFName)
EndIf
|