DeclareFunctionGetDriveTypeLib"kernel32"Alias"GetDriveTypeA"(ByValnDriveAsString)AsLong
该函数返回系统驱动器类型,返回值为5即为光驱,下面这个例子仅作简单的演示,你可以做进一步的改进以用在您自己的应用程序当中
PrivateSubGetCDRomLetter()
DimDriveNumAsInteger
DimDriveType
DimCDRomAsInteger
DimDriveLetterAsString
DimiAsByte
DriveNum=1
Do
DriveNum=DriveNum 1
DriveLetter=Chr(DriveNum 65) ":"
DriveType=GetDriveType(DriveLetter)
IfDriveType=DRIVE_CDROMThenDebug.PrintDriveLetter'DRIVE_CDROM=5
LoopUntilDriveType=1'返回值为...[ 查看全文 ]