Как определить, какие диски находятся на компьютере

Советы » Диски » Как определить, какие диски находятся на компьютере

function DriveExists(Drive:Byte):Boolean; var
  Drives: set of 0..25; begin
  integer(Drives):=GetLogicalDrives;   Result:=Drive in Drives end;

function CheckDriveType(Drive: Byte): string; var
  DriveLetter: Char;   DriveType: UInt;
begin
  DriveLetter:=Chr(Drive + $41);   DriveType:=GetDriveType(PChar(DriveLetter + ':'));   case DriveType of     0:               Result:='?';
    1:               Result:='Path does not exists';     DRIVE_REMOVABLE: Result:='Removable';     DRIVE_FIXED:     Result:='Fixed';     DRIVE_REMOTE:    Result:='Remote';     DRIVE_CDROM:     Result:='CD_ROM';     DRIVE_RAMDISK:   Result:='RAMDISK'     else       Result:='Unknown'   end end;

Другое по теме:

Категории

Статьи

Советы

Copyright © 2023 - All Rights Reserved - www.delphirus.com