Get Drive Type in VB.NET
July 23, 2009 in Windows programming | Tags: drive type
Dim Drives() As DriveInfo = DriveInfo.GetDrives()
Dim Builder As New System.Text.StringBuilder
Dim Info As DriveInfo
For Each Info In Drives
Builder.Append("Drive name " & Info.Name & Environment.NewLine)
Builder.Append(" Drive type " & Info.DriveType.ToString & Environment.NewLine)
'Check the IsReady property to see if a drive is ready
If Info.IsReady = True Then
Builder.Append(" Drive format " & Info.DriveFormat & Environment.NewLine)
End If
Next
Array.Clear(Drives, 0, Drives.Length)
MessageBox.Show(Builder.ToString)
RSS 2.0 Comments Feed | Leave a Response | Trackback
Leave a Reply