Hey all,
I am using the below code to fill a listbox with just exensions I want.
If I just do "*.jpg" by itself it works fine. Loads all files with that extension
However, I am trying to add multiple extensions patterns, but my list box goes blank.
I know I don't have this right.
I have been doing a lot of digging on Google and many offer sample code, but none if them seem to work.
Can any one help me with this??
Thanks in advance
I am using the below code to fill a listbox with just exensions I want.
If I just do "*.jpg" by itself it works fine. Loads all files with that extension
However, I am trying to add multiple extensions patterns, but my list box goes blank.
Code:
Dim filesI As New List(Of String)
Dim fileStrI
fileStrI = txtIMG.Text & "\"
filesI.AddRange(IO.Directory.GetFiles(fileStrI, "*.jpg,*.png"). '<--- DOESN'T WORK AT RUNTIME - NO ERRORS AT DESIGNTIME
Select(Function(f) IO.Path.GetFileName(f)))
ListBox3.Items.Clear()
ListBox3.Items.AddRange(filesI.ToArray)
I have been doing a lot of digging on Google and many offer sample code, but none if them seem to work.
Can any one help me with this??
Thanks in advance