Quantcast
Viewing all articles
Browse latest Browse all 42292

VS 2008 How to look for files with certain suffix?

Hello everyone!:) I just started learning VB and I am having fun! This is my first post on VB forum, please help a newbie!

In the design window, I have added a list box item named lstData and a botton called btnLooping

Private Sub btnLooping_Click……..

‘clear the list
ClearList ()

‘List each folder at the root of your C drive
For Each strFolder As String In _
My.Computer.FileSystem.GetDirectories (“C:\”)

‘Add the item to the list
lstData.Items.Add(strFolder)
Next
End Sub

In the above looping, I can show all the folders in my C drive. Is there a inbuilt function like “GetDirectories” that I can use to list all the files with a certain suffix? For example “.txt”?

Or if such result is to be realized (showing files with certain suffix), what should I do with VB? Could anyone help?

Thank you!

Viewing all articles
Browse latest Browse all 42292

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>