Autor Beitrag
crandzy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 42

WIN 2000
D2006 Prof
BeitragVerfasst: Do 17.02.05 16:19 
Hi, ich habe ein kleines Problem die Größe von Dateien auf einer CD anzuzeigen.
Er soll mir auf Knopfdruck die einzelnen Größen der Dateien in Byte in eine ListBox laden...
Hat jemand eine Hilfreiche Idee???
Mit FileSize hab ichs schon versucht
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Do 17.02.05 16:21 
Hallo :welcome:

crandzy hat folgendes geschrieben:
Mit FileSize hab ichs schon versucht

Mit welchem Ergebnis?
wulfskin
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1349
Erhaltene Danke: 1

Win XP
D5 Pers (SSL), D2005 Pro, C, C#
BeitragVerfasst: Do 17.02.05 17:12 
Hallo,

schonmal die Hilfe zu FileSize angesehen? Wenn ich mich recht erinnere, dann musst du die Datei davor geöffnet haben.
Ich benutz allerdings immer diese Funktion, da diese auch mit großen Dateien funktioniert:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
function MyGetFileSize(const FileName: String): Int64;
var
  hFile: THandle;
  Data: WIN32_FIND_DATA;
  Size: LARGE_INTEGER;
begin
  Result := -1;
  hFile := FindFirstFile(PChar(FileName), Data);
  try
    if hFile <> INVALID_HANDLE_VALUE then begin
      Size.LowPart := Data.nFileSizeLow;
      Size.HighPart := Data.nFileSizeHigh;
      Result := Size.QuadPart;
    end;
  finally
    Windows.FindClose(hFile);
  end;
end;
Gruß Hape!

_________________
Manche antworten um ihren Beitragszähler zu erhöhen, andere um zu Helfen.
crandzy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 42

WIN 2000
D2006 Prof
BeitragVerfasst: Fr 18.02.05 08:47 
Danke mit dieser Funktion funktioniert es :lol: