频道分类

Delphi 快速获取文件大小(使用_lopen和FileSeek,此函数可以快速获取文件大小,即使文件已经被其它程序锁定)

作者:admin 来源: 日期:2019/12/31 13:22:17 人气: 标签:

 function GetFileSize(const fName: AnsiString): Int64;
var
  hFile: THandle;
begin
  hFile := _lopen(PAnsiChar(fName), OF_READ);
  Result := FileSeek(hFile, Int64(0), 2);
  _lclose(hFile);
end;
 
来源:https://www.cnblogs.com/findumars/p/7841231.html