标题: 能不能判断我的电脑有否光驱 [打印本页] 作者: make 时间: 2002-5-22 04:46 标题: 能不能判断我的电脑有否光驱 能不能判断我的电脑有否光驱 ,用ACCESS怎么做啊作者: tmtony 时间: 2002-5-22 06:07
用API试试
Function long GetDriveTypeA(string nDrive)Library "kernel32"
循环A到Z驱动器
ll_drive=GetDriveTypeA("A")
CHOOSE CASE ll_drive
CASE 2
drvinfo='可移动驱动器'
CASE 3
drvinfo='固定驱动器'
CASE 4
drvinfo='网络驱动器'
CASE 5
drvinfo='CD-ROM驱动器'
CASE ELSE
drvinfo='不是驱动器'
END select
作者: MsAccess 时间: 2002-5-22 17:04
不用API也可以,用 FSO:
Sub ShowDriveType(drvpath)
Dim fs, d, s, t
Set fs = CreateObject("Scripting.FileSystemObject")
Set d = fs.GetDrive(drvpath)
Select Case d.DriveType
Case 0: t = "未知"
Case 1: t = "可移动驱动器"
Case 2: t = "固定驱动器"
Case 3: t = "网络驱动器"
Case 4: t = "CD-ROM"
Case 5: t = "RAM 驱动器"
End Select
s = "Drive " & d.DriveLetter & ": - " & t
MsgBox s
End Sub