سلام؛نقل قول:
نوشته شده توسط ooje_asman
فکر مي کنم اين کد نمونه به درد شما بخوره:
کد:Imports System.Runtime.InteropServices
Module Module1
Public Enum DriveType
DRIVE_UNKNOWN = 0
DRIVE_NO_ROOT_DIR = 1
DRIVE_REMOVABLE = 2
DRIVE_FIXED = 3
DRIVE_REMOTE = 4
DRIVE_CDROM = 5
DRIVE_RAMDISK = 6
End Enum
<DllImport("kernel32.dll")> Public Function GetDriveType(ByVal
strRootPath As String) As Integer
End Function
Sub Main()
Dim strRootPath As String
For Each strRootPath In Environment.GetLogicalDrives
If GetDriveType(strRootPath) = DriveType.DRIVE_CDROM Then
Console.WriteLine(strRootPath & " is a CD drive")
End If
Next
Console.ReadLine()
End Sub
End Module