How to list all files in a folder including subfolder files.
horserider
0
Light Poster
Recommended Answers
Jump to PostI hope it helps :
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ' make a reference to a directory Dim di As New IO.DirectoryInfo("c:\") Dim diar1 As IO.FileInfo() = di.GetFiles() Dim dra As IO.FileInfo 'list the names of all files in the …
Jump to PostSince you have not mentioned which control to add the Files to, I will also use a ListBox.
Dim myCoolFolder As String = "C:\Program Files" '// your Folder. Try For Each myCoolFile As String In My.Computer.FileSystem.GetFiles _ (myCoolFolder, FileIO.SearchOption.SearchAllSubDirectories, "*.*") 'ListBox1.Items.Add(IO.Path.GetFileName(myCoolFile)) '// add only File Name with …
Jump to PostSee if this helps.
1 Button, 1 ListBox, 1 BackgroundWorkerPublic Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Control.CheckForIllegalCrossThreadCalls = False '// allow cross threading. End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click BackgroundWorker1.RunWorkerAsync() '// …
All 9 Replies
a1a4a
0
Newbie Poster
codeorder
197
Nearly a Posting Virtuoso
horserider
0
Light Poster
codeorder
197
Nearly a Posting Virtuoso
kvprajapati
commented:
Helpful!
+12
horserider
0
Light Poster
codeorder
197
Nearly a Posting Virtuoso
horserider
0
Light Poster
horserider
0
Light Poster
horserider
0
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.