Autor Beitrag
Daniel_100
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 63

Win XP
D3 Prof, D6 Enterprise
BeitragVerfasst: Mo 04.08.03 12:36 
Hallo!

Ich möchte gerne die Größe einer Datei in einem Label anzeigen lassen.

Danke

Daniel
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mo 04.08.03 12:49 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
function MyGetFileSize(const Filename: string): TULargeInteger;
var
  Find: THandle;
  Data: TWin32FindData;
begin
  Result.QuadPart := -1;
  Find := FindFirstFile(PChar(Filename), Data);
  if (Find <> INVALID_HANDLE_VALUE) then
  begin
    Result.LowPart := Data.nFileSizeLow;
    Result.HighPart := Data.nFileSizeHigh;
    Windows.FindClose(Find);
  end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
  if (OpenDialog1.Execute) then
    ShowMessage(IntToStr( MyGetFileSize(OpenDialog1.FileName).QuadPart ));
end;
Daniel_100 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 63

Win XP
D3 Prof, D6 Enterprise
BeitragVerfasst: Mo 04.08.03 13:08 
Ok, danke!