How can you detect the removable disk from vb.net ie whether the USB drive is connected or not?

Showing Answers 1 - 1 of 1 Answers

sub checkusbconnected
dim drv as driveinfo()=io.drives.getdrives()
dim bl as boolean
for i as integer=0 to drv.length-1
if drv(i).drivetype=drivetype.removable
bl=true
exit for
end if
next
if bl=true then
msgbox "Usb connected"
else
msgbox "Usb not connected"
end sub

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions