Accidentboy
سه شنبه 06 اسفند 1387, 13:22 عصر
سلام
می خواستم سایز یه قایلی آدرس شو هم دارم پیدا کنم چجوری ؟
با تشکر
Hsimple11
سه شنبه 06 اسفند 1387, 13:32 عصر
function Get_File_Size(sFileToExamine: string; bInKBytes: Boolean): string;
var
  SearchRec: TSearchRec;
  sgPath: string;
  inRetval, I1: Integer;
begin
  sgPath := ExpandFileName(sFileToExamine);
  try
    inRetval := FindFirst(ExpandFileName(sFileToExamine), faAnyFile, SearchRec);
    if inRetval = 0 then
      I1 := SearchRec.Size
    else
      I1 := -1;
  finally
    SysUtils.FindClose(SearchRec);
  end;
  Result := IntToStr(I1);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
  if OpenDialog1.Execute then
    label1.Caption := Get_File_Size(Opendialog1.FileName, True);
end;
vBulletin® v4.2.5, Copyright ©2000-1404, Jelsoft Enterprises Ltd.