判断文件大小的函数


function GetFileSize(const FileName: String): LongInt;

var SearchRec: TSearchRec;

begin

  if FindFirst(ExpandFileName(FileName), faAnyFile, SearchRec) = 0 then

   Result := SearchRec.Size

  else

   Result := -1;

end;


 
   

你可能感兴趣的:(文件大小)