1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
var
FN: string;
iLetter: Integer;
DrivePath: string;
const
DT: array[DRIVE_UNKNOWN .. DRIVE_RAMDISK] of string =
('Inconnu', 'Chemin invalide', 'Amovible', 'Fixe', 'Serveur Distant', 'Disque CD', 'RAM');
begin
for iLetter := Ord('A') to Ord('Z') do
begin
DrivePath := Chr(iLetter) + ':\';
if GetDriveType(PChar(DrivePath)) > DRIVE_NO_ROOT_DIR then
FN := FN + DrivePath + ':' + DT[GetDriveType(PChar(DrivePath))] + #13#10;
end;
FN := FN + ParamStr(0) + ':' + DT[GetDriveType(PChar(ExtractFilePath(ParamStr(0))))] + #13#10;
ShowMessage(FN); |
Partager