精华区 [关闭][返回]

当前位置:网易精华区>>讨论区精华>>编程开发>>● VB和Basic>>● VB和Basic(1)>>API函数>>vb6中怎樣判斷電腦上哪一個盤是cd-rom?

主题:vb6中怎樣判斷電腦上哪一個盤是cd-rom?
发信人: ganz()
整理人: fishy(2000-03-30 10:26: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]

[关闭][返回]