Reputation: 65
I am relatively new to visual basic and I am working on a project in which I am going to need to create a "link" to individual files that are within a certain directory. This way the user can see all of the files listed out can click on an individual file and run certain things on it. I am sure there are plenty of ways to do this, but if you guys could please give me a few ideas on how I may accomplish this it would be greatly appreciated.
Thanks, Kyle R.
Upvotes: 1
Views: 8693
Reputation: 28059
Visual Studio uses VB.Net, and you literally do this:
Dim eachFileInMydirectory As String() = Directory.GetFiles("C:\mydirectory")
Now all of the files in mydirectory are stored in eachFileInMydirectory, which is an array of string. You will need to add the following line to the very top of your VB file:
Imports System.IO
Upvotes: 4