Hi, i have an application that detects a drive being inserted with this code:
But it doesn't show the name of the drive... only the driveletter like G:\, how can i identify each drive? Like it's name or something... ?
Dim driveNames As New List(Of String)
For Each drv As System.IO.DriveInfo In System.IO.DriveInfo.GetDrives
If drv.DriveType = IO.DriveType.Removable AndAlso drv.IsReady Then
Dim drvLetter As String = drv.Name
'Dim drvVolume As String = drv.VolumeLabel
' Dim drvSpaceAvailable As String = ShowTotalFileSize(drv.AvailableFreeSpace)
If ListBox1.Items.IndexOf(drv.Name) = -1 Then
If ListBox2.Items.IndexOf(drv.Name) = -1 Then
MsgBox(drv.Name & " has been detected.", MsgBoxStyle.Information, "New Drive")
ListBox2.Items.Add(drv.Name)
End If
End If
End If
Next
But it doesn't show the name of the drive... only the driveletter like G:\, how can i identify each drive? Like it's name or something... ?