delphi获得硬盘所有分区


本文整理自网络,侵删。

 //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;

相关阅读 >>

Delphi format格式化函数

Delphi 文件传输的代码

Delphi 取得当前运行窗口的标题

Delphi mscomm 实时串口通讯

Delphi 中相对路径与绝对路径、系统环境变量等相关函数说明

Delphi tstream 详细介绍

Delphi getfiletype 判断图像文件类型

Delphi 字节数转换为kb或mb字符串

Delphi二进制字符串转换成中文字符串

Delphi用twebbrowser组件在Delphi中post数据和取得网页源文件

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...