Главная страница | назад





Article #15789: Getting a list of the available drives on a system

 Question and Answer Database
FAQ789D.txt Getting a list of the available drives on a system
Category :Windows API
Platform :All
Product :All 32 bit
Question:
Is there a fast way to get a list of the available drives on a
system?
Answer:
The following example demonstrates getting a list of the available
logical drives available on the system.
procedure TForm1.Button1Click(Sender: TObject);
var
ld : DWORD;
i : integer;
begin
ld := GetLogicalDrives;
for i := 0 to 25 do begin
if (ld and (1 shl i)) <> 0 then
Memo1.Lines.Add(Char(Ord('A') + i) + ':\');
end;
end;
7/16/98 4:31:28 PM

Last Modified: 01-SEP-99