Autor Beitrag
Salvador
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 30



BeitragVerfasst: Fr 31.01.03 22:33 
Hallo,
Habe 2 Fragen:
1: Wie kann ich einfach auslesen, welche Laufwerke existieren (egal ob CD-Rom oder HD)
2: Wie kann ich zu jedem laufwerk abfragen, wieviel Speicherplatz zur Verfügung steht?

mfg!
Salvador
Sivar
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 40



BeitragVerfasst: Fr 31.01.03 22:56 
Bei mir (Delphi 5) gibts die Funktion "DiskSize" - schau mal in der Delphi Hilfe ob du dazu was findest.

Gruß
Sivar
Salvador Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 30



BeitragVerfasst: Sa 01.02.03 02:06 
Gut, das funktioniert....Aber wie lese ich aus welche Laufwerke existieren?
Brueggendiek
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 304

Win 98, Win98SE, Win XP Home
D5 Std
BeitragVerfasst: Sa 01.02.03 03:54 
Hallo!

ausblenden Quelltext
1:
2:
3:
4:
function LaufwerkVorhanden(Laufwerk: Char): Boolean;
begin
  Result := GetDriveType(Pchar(Laufwerk + ':\')) > DRIVE_NO_ROOT_DIR;
end;


liefert die Angabe, ob ein Laufwerk existiert.
Das gilt auch für Netzlaufwerke.

Falls Du spezielle Laufwerke brauchst, schau in die OH zu GetDriveType - da werden die Rückgabewerte erklärt. Die obige Konstante ist von Delphi in der Unit Windows definiert.

Gruß

Dietmar Brüggendiek