Here is the code in vb .Net
Code: Select all
Private DeviceVolumeLabel As String = "PACEMAKER"
Public Function FindPacemakerDrive() As Boolean
PacemakerDrive = ""
PacemakerPresent = False
For Each drive As DriveInfo In DriveInfo.GetDrives()
If drive.DriveType = DriveType.Removable AndAlso drive.IsReady Then
If drive.VolumeLabel.ToUpper = DeviceVolumeLabel Then
PacemakerDrive = drive.Name
PacemakerPresent = True
Return True
End If
End If
Next drive
Return False
End Function