比较两个文件时间
#Include <Date.au3>
_Date_Time_CompareFileTime($pFileTime1, $pFileTime2)
$pFileTime1 | 第一个 $tagFILETIME 数据结构的指针 |
$pFileTime2 | 第二个 $tagFILETIME 数据结构的指针 |
#include <GUIConstantsEx.au3>
#include <Date.au3>
#include <WindowsConstants.au3>
Global $iMemo
_Main()
Func _Main()
Local $pFileTime1, $tFileTime1, $pFileTime2, $tFileTime2
; 创建 GUI
GUICreate("Time", 400, 300)
$iMemo = GUICtrlCreateEdit("", 2, 2, 396, 296, $WS_VSCROLL)
GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New")
GUISetState()
; 比较 FAT 日期/时间
$tFileTime1 = _Date_Time_DOSDateTimeToFileTime(0x3621, 0x11EF) ; 01/01/2007 02:15:30
$tFileTime2 = _Date_Time_DOSDateTimeToFileTime(0x379F, 0x944A) ; 12/31/2007 18:34:20
$pFileTime1 = DllStructGetPtr($tFileTime1)
$pFileTime2 = DllStructGetPtr($tFileTime2)
MemoWrite("Result 1: " & _Date_Time_CompareFileTime($pFileTime1, $pFileTime2))
MemoWrite("Result 2: " & _Date_Time_CompareFileTime($pFileTime1, $pFileTime1))
MemoWrite("Result 3: " & _Date_Time_CompareFileTime($pFileTime2, $pFileTime1))
; 循环直到用户退出
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc ;==>_Main
; 写入一行到 memo 控件
Func MemoWrite($sMessage)
GUICtrlSetData($iMemo, $sMessage & @CRLF, 1)
EndFunc ;==>MemoWrite