function GetFileTimes(const FileName: string; var Created: TDateTime;<br>var Accessed: TDateTime; var Modified: TDateTime): Boolean;<br>var<br> h: THandle;<br> Info1, Info2, Info3: TFileTime;<br> SysTimeStruct: SYSTEMTIME;<br> TimeZoneInfo: TTimeZoneInformation;<br> Bias: Double;<br>begin<br> Result := False;<br> Bias := 0;<br> h := FileOpen(FileName, fmOpenRead or fmShareDenyNone);<br> if h &gt; 0 then <br> begin<br> try<br> if GetTimeZoneInformation(TimeZoneInfo) &lt;&gt; $FFFFFFFF then<br> Bias := TimeZoneInfo.Bias / 1440; // 60x24<br> GetFileTime(h, @Info1, @Info2, @Info3);<br> if FileTimeToSystemTime(Info1, SysTimeStruct) then<br> Created := SystemTimeToDateTime(SysTimeStruct) - Bias;<br> if FileTimeToSystemTime(Info2, SysTimeStruct) then<br> Accessed := SystemTimeToDateTime(SysTimeStruct) - Bias;<br> if FileTimeToSystemTime(Info3, SysTimeStruct) then<br> Modified := SystemTimeToDateTime(SysTimeStruct) - Bias;<br> Result := True;<br> finally<br> FileClose(h);<br> end;<br> end;<br>end;<br><br><br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> Date1, Date2, Date3: TDateTime;<br>begin<br> if GetFileTimes(Edit1.Text, Date1, Date2, Date3) then <br> begin<br> ShowMessage('Created: ' + DateTimeToStr(Date1)); //创建日期<br> ShowMessage('Last Accessed: ' + DateTimeToStr(Date2)); //最后访问日期<br> ShowMessage('Last Modified: ' + DateTimeToStr(Date3)); //最后访修改日期<br> end;<br>end; <br>