C# Programming
12-07-2009, 07:22 PM
Hi,
I'm trying to get all the files from directory that ends with *.txt only.
The problem is, when i'm doing:
string[] filePaths = Directory.GetFiles(@"C:\MyDir\", "*.txt");
i get also the path.
How can i get only the filename?
(at the end i have to get a string[] because i need to use it as DataSource)
I'm trying to get all the files from directory that ends with *.txt only.
The problem is, when i'm doing:
string[] filePaths = Directory.GetFiles(@"C:\MyDir\", "*.txt");
i get also the path.
How can i get only the filename?
(at the end i have to get a string[] because i need to use it as DataSource)