作者在 2015-02-17 22:06:12 发布以下内容
Local lnI, drvName, drvType ,mydri
mydri=""
for lni=1 to 25
drvname=chr(64+lni)+": "
drvtype=drivetype(drvname)
do case
case drvtype = 1
driname="驱动器 " + drvname + "无类型"
case drvtype = 2
driname="驱动器 " + drvname + "是一个软盘驱动器"
case drvtype = 3
driname="驱动器 " + drvname + "是一个硬盘驱动器"
case drvtype = 4
driname="驱动器 " + drvname + "是一个可移去式驱动器或网络驱动器"
case drvtype = 5
driname="驱动器 " + drvname + "是一个CD-ROM驱动器"
case drvtype = 6
driname="驱动器 " + drvname + "是一个RAM 盘"
endcase
mydri=mydri+iif(directory(drvname),chr(13)+chr(13)+driname,"")
endfor
messagebox(mydri)
方法二:
? "枚举电脑上的所有驱动器:"
* WSH
Local loFSO, loDrive
loFSO = Createobject('Scripting.FileSystemObject')
For Each loDrive In loFSO.Drives
? loDrive.DriveLetter, loDrive.Drivetype, loDrive.isReady, IIF(loDrive.isReady, loDrive.Totalsize, -1)
Next