WEB开发网
开发学院软件开发Delphi 得到当前的光驱的盘符 阅读

得到当前的光驱的盘符

 2006-02-04 13:26:21 来源:WEB开发网   
核心提示:PRocedure GetCDROM(var CD:char);varstr:string;Drivers:Integer;driver:char;i,temp:integer;beginDrivers:=GetLogicalDrives;temp:=(1 and Drivers);for i:=0 to 26 dob
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;

Tags:得到 当前 光驱

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接