FRIBBLE1
asked on
Trubble with System.IO.Directory.GetLogicalDrives.GetType
I'm trying to find out what type of each drive is then remove the ones which arnt hard drives.
The GetLogicalDrives works fine but how do i then uses this incomation in the Get type method.
drives = System.IO.Directory.GetLog icalDrives
System.IO.Directory.GetLog icalDrives .GetType()
Thanks for your help
The GetLogicalDrives works fine but how do i then uses this incomation in the Get type method.
drives = System.IO.Directory.GetLog
System.IO.Directory.GetLog
Thanks for your help
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
oops, too slow on the draw :)
ASKER
Thanks very much
FWIW, stick with iboutchkine's suggestion, or some version of that anyway. This blog (http://blogs.vbcity.com/drydo/) shows that it is faster than the one I posted :)
Private Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA"
(ByVal nDrive As String) As Int32
Dim s As String
Dim drivers() As String = Directory.GetLogicalDrives
For Each s In drivers
If GetDriveType(s) = 5 Then
Console.WriteLine("drive letter {0} is a CDROM", s)
End If
Next