[Delphi (Object Pascal)] Delphi 获取计算机所有驱动器名称列表 →→→→→进入此内容的聊天室

来自 , 2020-10-12, 写在 Delphi (Object Pascal), 查看 220 次.
URL http://www.code666.cn/view/735ddec1
  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

回复 "Delphi 获取计算机所有驱动器名称列表"

这儿你可以回复上面这条便签

captcha