精华区 [关闭][返回]

当前位置:网易精华区>>讨论区精华>>编程开发>>● VB和Basic>>〓〓..API 函数使用..〓〓>>文件系统>>判断哪个驱动器是CD-ROM

主题:判断哪个驱动器是CD-ROM
发信人: ganz()
整理人: winsy(2003-03-05 15:36:30), 站内信件
Public Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTyp
eA" (ByVal nDrive As String) As Long
......
dim lType as long
dim sDrive as string
sDrive=(C:,d:,E:,... etc)
lType=GetDriveType(sDrive & "\")
The return value specifies the type of drive. It can be one of the fol
lowing values: 
0               The drive type cannot be determined.
1          The root directory does not exist.
DRIVE_REMOVABLE2 The drive can be removed from the drive.
DRIVE_FIXED3 The disk cannot be removed from the drive.
DRIVE_REMOTE4 The drive is a remote (network) drive.
DRIVE_CDROM5 The drive is a CD-ROM drive.
DRIVE_RAMDISK6 The drive is a RAM disk.


--
※ 来源:.月光软件站 http://www.moon-soft.com.[FROM: 202.101.200.11]

[关闭][返回]