delphi获取本地全部盘符并存如combobox1


本文整理自网络,侵删。

 var
  DriveNum: Integer;
  DriveChar: Char;
  DriveType: TDriveType;
  DriveBits: set of 0..25;
begin
  monitorthread := nil;
  combobox1.clear;
  Integer(DriveBits) := GetLogicalDrives;
  for DriveNum := 0 to 25 do
  begin
    if not (DriveNum in DriveBits) then Continue;
    DriveChar := Char(DriveNum + Ord('A'));//从a---z
    DriveType := TDriveType(GetDriveType(PChar(DriveChar + ':')));
    case DriveType of
      dtFixed:    combobox1.Items.Add(DriveChar+':');
    end;
  end;
  combobox1.itemindex:=0;
  ComboBox1Change(Sender);
end;

相关阅读 >>

Delphi 过滤字符串首位特殊符号

Delphi winapi: getforegroundwindow - 获取前台窗口的句柄

Delphi内存对齐

Delphi中使用directx截屏函数

Delphi设计循环播放声音文件程序

Delphi将n个相同字符提取到左边,m个相同字符提取到右边

Delphi 获取当前输入法

Delphi 生成并替换txt里的内容

Delphi 根据字符串分隔符位置取值

Delphi 简单的字符串加密和解密

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



打赏

取消

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

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

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

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

评论

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