2020年7月10日 星期五

vb.net 取得磁碟機類型 [Get Disk Type]

1
2
3
4
5
6
7
8
9
Public Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" (ByVal nDrive As String) As Long
'1 磁碟機不存在
'2 可抽取是磁碟機
'3 硬式磁碟機
'4 連線磁碟機
'5 光碟機
'6 虛擬磁碟機

Msgbox GetDriveType("C:\") 

沒有留言:

張貼留言