当前位置:编程学习 > Delphi >>

得到当前的光驱的盘符。

procedure GetCDROM(var CD:char);
var
str:string;
Drivers:Integer;
driver:char;
i,temp:integer;
begin
Drivers:=GetLogicalDrives;
temp:=(1 and Drivers);
for i:=0 to 26 do
begin
  if temp=1 then
    begin
      driver:=char(i+integer(a));
      str:=driver+:;
      if   GetDriveType(pchar(str))=DRIVE_CDROM then
       begin
         cd:=driver;
         exit;
       end;
    end;
  drivers:=(drivers shr 1);
  temp:=(1 and Drivers);
end;
end;
补充:软件开发 , Delphi ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,