本文整理自网络,侵删。
//Delphi 获取系统所有驱动器列表program Project2;
{$APPTYPE CONSOLE}
{$R *.res}
uses System.SysUtils,System.IOUtils, Types, TypInfo;
var s: string; arr: TStringDynArray;
begin try arr := TDirectory.GetLogicalDrives;
for s in arr do begin Writeln(s);end;
Readln; { TODO -oUser -cConsole Main : Insert code here } except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end;end.
相关阅读 >>
Delphi中使用内联变量(inline variables) 的5个理由
Delphi idhttp中application/x-www-form-urlencoded字符说明
Delphi 莫名奇妙的错误 Delphi is not a valid integer value
Delphi读写文本文件 assignfile reset append
更多相关阅读请进入《Delphi》频道 >>