欢迎光临
我们一直在努力

获取第一个光驱盘符_delphi教程

建站超值云服务器,限时71元/月

{
***************************************
Get the First CD ROM
***************************************
}
function GetCDROM():string;
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
                                   GetCDROM:=driver;
                                   exit;
                          end;
                  end;
                drivers:=(drivers shr 1);
                temp:=(1 and Drivers);
        end;
end;

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 获取第一个光驱盘符_delphi教程
分享到: 更多 (0)