Get Files

  • Thread starter Thread starter Flying Whiz
  • Start date Start date
F

Flying Whiz

I am trying to return files with .txt extension in a List box using
..NET CF.

I am trying with the following code

Dim StrFiles() As String
Dim StrFile As String

StrFiles = System.IO.Directory.GetFiles("\Program
Files\AITS_Tool\", "*.txt")

'StrFiles = System.IO.Directory.GetFiles(txtSource.text, "*.*")

For Each StrFile In StrFiles
ListBox1.Items.Add(StrFile)
Next

When trying with this code it's showing the entire path in the list
box where as I want to show only the txt file name for Ex :
xyz.txt.How can I return only files with .txt extension ?

Thanks
Whiz
 
Back
Top