I am trying to read information from any TXT file in a folder. How can I use *.txt?
Thanks
Printable View
I am trying to read information from any TXT file in a folder. How can I use *.txt?
Thanks
The Directory.GetFiles method lets you specify a search pattern:
Code:For Each f As String In Directory.GetFiles("C:\Temp", "*.txt")
' do something with f
MessageBox.Show(f)
Next
Thanks, I did it this way and it worked too
For Each foundfiles As String In My.Computer.FileSystem.GetFiles(Logfilefolder, FileIO.SearchOption.SearchTopLevelOnly