delphi 获取文件修改时间


本文整理自网络,侵删。

 function filectime(filename:string):tdatetime;
 var
      vSearchRec:   TSearchRec;   
      LocalFileTime:   TFileTime;   
      I:   Integer;   
  begin   
      if   FindFirst(filename,   faAnyFile,   vSearchRec)   =   0   then

      FileTimeToLocalFileTime(vSearchRec.FindData.ftLastWriteTime,   LocalFileTime);   
      FileTimeToDosDateTime(LocalFileTime,   LongRec(I).Hi,   LongRec(I).Lo);
   //   Memo1.Lines.Values['修改时间']   :=   DateTimeToStr(FileDateToDateTime(I));
      FindClose(vSearchRec);
   result:=FileDateToDateTime(I);
end;

相关阅读 >>

如何用Delphi实现子目录级的文件查询

Delphi messagebox 使用

Delphi memo 控件光标定位

Delphi 获取系统桌面大小

Delphi firedac 下的 sqlite [4] - 创建数据库

Delphi 获取文件大小方法

Delphi tstopwatch 计时

Delphi利用getprocessmemoryinfo获取进程占用内存大小

Delphi 屏幕拷贝程序的源代码

Delphi 用sql语句添加删除修改字段

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...