Detect drives that could contain removeable media

G

Guest

Is there a simple approach in vb.net to search logical drives to determine
which are removeable media types (e.g., a zip drive or the A drive)?
I've used FSO with VB6 for this and am now searching for a vb.net replacement.
 
S

Siva M

For Each di As DriveInfo In DriveInfo.GetDrives()
If (di.DriveType = DriveType.Removable) Then
Console.WriteLine (di.Name & " is removable")
End If
Next

Is there a simple approach in vb.net to search logical drives to determine
which are removeable media types (e.g., a zip drive or the A drive)?
I've used FSO with VB6 for this and am now searching for a vb.net
replacement.
 
S

Siva M

It is in System.IO namespace. Remember it is only from .NET 2.0

Thanks. How do I define DriveInfo? What reference do I use?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top