Guden all ma ne Frage zu dem Ding da
ich rechne meine FreeSpace auf der Platte aus, wo mein Prog drauf iss mmit diesem code
Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25:
| function GetDiskSize(drive:Char; var free_size, total_size: Int64):Boolean; var RootPath :Array[0..4] of Char; RootPtr :PChar; current_dir :String; Begin RootPath[0] := Drive; RootPath[1] := ':'; RootPath[2] := '\'; RootPath[3] := #0; RootPtr := RootPath; current_dir := GetCurrentDir; If SetCurrentDir(drive + ':\') then begin GetDiskFreeSpaceEx(RootPtr, Free_size, Total_size,nil); SetCurrentDir(current_dir); Result := True; end else Begin Result := False; Free_size := -1; total_size := -1; end; end; |
mir iss klar, das ich bei free_size keine mb oder gigabitewerte bekomme , aber wenn ich das anzeige mit Gauge1.progress := free_size;
isses immer 100% also wie kann ich das umrechnen, das ich die richtige % Zahl rausbekomme?