如何利用GetLogicalDrives得到本机的驱动盘?
var
str: string;
drivers: integer;
driver: char;
i, temp: integer;
begin
drivers := getlogicaldrives;
temp := (1 and drivers);
for i := 0 to 26 do
begin
if temp = 1 then
begin
driver := char(i + integer('A'));
str := driver + ':\';
if (driver <> '') and (getdrivetype(pchar(str)) <> drive_cdrom)
and (getdrivetype(pchar(str)) <> DRIVE_REMOVABLE) then
ComboBox1.Items.add(str);
end;
drivers := (drivers shr 1);
temp := (1 and drivers);
end;
str: string;
drivers: integer;
driver: char;
i, temp: integer;
begin
drivers := getlogicaldrives;
temp := (1 and drivers);
for i := 0 to 26 do
begin
if temp = 1 then
begin
driver := char(i + integer('A'));
str := driver + ':\';
if (driver <> '') and (getdrivetype(pchar(str)) <> drive_cdrom)
and (getdrivetype(pchar(str)) <> DRIVE_REMOVABLE) then
ComboBox1.Items.add(str);
end;
drivers := (drivers shr 1);
temp := (1 and drivers);
end;