How to list all files in a folder including subfolder files.
horserider 0 Light Poster
Recommended Answers
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() '// …
Jump to PostEven w/the code I posted to "allow cross threading"?
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
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.