G
Guest
Hi,
Is there any class that watch for the logical drives installed in the
computer.
I want to enable a button in a windows form application when a USB stick is
inserted and recognised.
For the events I do a loop and always ask for the logical drives and to
differentiate from the local drive I've got this way around but I have to
know which drives are installed before a new one is inserted and I also dont
know what kind of drive it is.
_____________________________________________________________
logicalDrives = System.IO.Directory.GetLogicalDrives()
For Each logicalDrive In logicalDrives
directoryInfo = New System.IO.DirectoryInfo(logicalDrive)
If driveInfo.Exists Then
Dim str As String
str = driveInfo.FullName
'Only removable drives
If str <> "C:\" AND str <> "D:\"Then
found = True
Exit For
End If
End If
Next
________________________________________________________________
I have for example the problem that when I insert a floppy disk, my code
does not notice the diference (USB stick <> Floppy)
Thanks
Is there any class that watch for the logical drives installed in the
computer.
I want to enable a button in a windows form application when a USB stick is
inserted and recognised.
For the events I do a loop and always ask for the logical drives and to
differentiate from the local drive I've got this way around but I have to
know which drives are installed before a new one is inserted and I also dont
know what kind of drive it is.
_____________________________________________________________
logicalDrives = System.IO.Directory.GetLogicalDrives()
For Each logicalDrive In logicalDrives
directoryInfo = New System.IO.DirectoryInfo(logicalDrive)
If driveInfo.Exists Then
Dim str As String
str = driveInfo.FullName
'Only removable drives
If str <> "C:\" AND str <> "D:\"Then
found = True
Exit For
End If
End If
Next
________________________________________________________________
I have for example the problem that when I insert a floppy disk, my code
does not notice the diference (USB stick <> Floppy)
Thanks