[Delphi] 快速获取文件大小

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;

posted @ 2022-08-19 12:52  小洋房  阅读(176)  评论(0编辑  收藏  举报