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!
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!