随笔 - 2146  文章 - 97 评论 - 11778 trackbacks - 253

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;

posted on 2007-11-21 16:28  万一  阅读(4382)  评论(4编辑  收藏