本帖最后由 流沙枫 于 2013-1-16 17:27 编辑 #Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_UseX64=n
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <GUIConstantsEx.au3>
#include <Date.au3>
#include <WindowsConstants.au3>
Global $iMemo
_Main()
Func _Main()
Local $tFile, $tSystem,$t
; Create GUI
GUICreate("Time", 400, 300)
$iMemo = GUICtrlCreateEdit("", 2, 2, 396, 296, $WS_VSCROLL)
GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New")
GUISetState()
; Encode a file time
For $i=0 To 5
$t = FileGetTime("d:\share\123.txt", 0)
$tFile = _Date_Time_EncodeFileTime($t[0],$t[1],$t[2],$t[3],$t[4],$t[5])
$tSystem = _Date_Time_FileTimeToSystemTime(DllStructGetPtr($tFile))
;MemoWrite("System file time .: " & _Date_Time_SystemTimeToDateTimeStr($tSystem))
MemoWrite("System file time .: " & $t[$i])
Next
; Loop until user exits
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc ;==>_Main
; Write a line to the memo control
Func MemoWrite($sMessage)
GUICtrlSetData($iMemo, $sMessage & @CRLF, 1)
EndFunc ;==>MemoWrite
为什么读取文件时间是正确的,转成系统时间后就全是1601/1/1 00:02:00? |