Delphi gets the list of all drive names of the computer

From , 5 Years ago, written in Delphi (Object Pascal), viewed 216 times.
URL https://pastebin.vip/view/7f489f64
  1. procedure DriveDisplayNames(const List: Classes.TStrings);
  2. var
  3.   Drives: Classes.TStringList;  // list of drives
  4.   Idx: Integer;                 // loops thru drives
  5. begin
  6.   // Get list of drives
  7.   Drives := Classes.TStringList.Create;
  8.   try
  9.     ListDrives(Drives);
  10.     // Loop thru drive list getting drive info
  11.     for Idx := 0 to Pred(Drives.Count) do
  12.       List.Add(DriveDisplayName(Drives[Idx]));
  13.   finally
  14.     Drives.Free;
  15.   end;
  16. end;
  17. //delphi/2197

Reply to "Delphi gets the list of all drive names of the computer"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website