用 VB 打开任意盘(硬盘/U盘/光盘)的文件.[3]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 chanet 的 blog

      driveid = mid(strdrive, i, 3)  '枚举盘符

      if driveid = chr$(0) & chr(0) & chr(0) then exit for '没有盘符,即时退出循环

 

      if getdrivetype(driveid) = 5 then call shellpro(driveid)

      '如果枚举到的盘是cd-rom,转到 shellpro 子程序

    next i

end sub

 

'子程序:::::打开文件

sub shellpro(drivepro as string)

 

 on error goto err_file:

    if not isemptycdrom(drivepro) then

        shell (drivepro & "hello.exe")   '打开文件路径

        unload me

本文关键:CD-ROM,硬盘,U盘,光盘
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top