//delphi获得硬盘所有分区
procedure GetDrives(Drives: TStrings);
var
Drive: Char;
DriveLetter: string[4];
begin
for Drive := 'A' to 'Z' do
begin
DriveLetter := Drive + ':\';
if GetDriveType(PChar(Drive + ':\')) = DRIVE_FIXED then
Drives.Add(DriveLetter);
end;
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
GetDrives(ListBox1.Items);
end;