1

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.

4

1 に答える 1

4

Visual StudioはVB.Netを使用し、文字通りこれを行います。

Dim eachFileInMydirectory As String() = Directory.GetFiles("C:\mydirectory")

これで、mydirectory内のすべてのファイルが、文字列の配列であるeachFileInMydirectoryに格納されます。VBファイルの一番上に次の行を追加する必要があります。

Imports System.IO
于 2012-12-21T15:20:51.523 に答える