0

I have this vb code which detects when a pendrive is inserted. Can anyone help me to be able to access the content of the pendrive in my form?? Thank you

1 Answer 1

4

Use IO.Directory.GetDirectories() and IO.Directory.GetFiles() from the path of the pendrive. You can see the MSDN documentation here and here, respectively.

Improve your question in order to have more specific answers.

EDIT:

Adding the file names into a ListBox:

Dim allFiles() As String = Directory.GetFiles(penDrivePath)

For Each file As String in allFiles
    ListBox1.Items.Add(file)
Next
1
  • thanks. I would like the files on the pendrive to be shown in a list box
    – Arnold
    Feb 28, 2013 at 11:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.