Hi!
Like I said in the title, I want to populate a listbox with text files from a folder.
I know hot to populate that listbox with all the files from a directory, but i don't know how to filter those files to .txt files only.
My code for populating the listbox is:
Thanks!
Like I said in the title, I want to populate a listbox with text files from a folder.
I know hot to populate that listbox with all the files from a directory, but i don't know how to filter those files to .txt files only.
My code for populating the listbox is:
VB.NET:
ListBox2.Items.Clear()
For Each fisier As String In My.Computer.FileSystem.GetFiles(System.AppDomain.CurrentDomain.BaseDirectory())
ListBox2.Items.Add(Path.GetFileNameWithoutExtension(fisier))
Next
Thanks!