I have several .Sql files in this directory: C:\Users\anacarvalho\Desktop\Teste
How do I get all these files?
I have several .Sql files in this directory: C:\Users\anacarvalho\Desktop\Teste
How do I get all these files?
Use the Directory.GetFiles with the search option in all directories
var Arquivos= Directory.GetFiles(@"C:\Users\anacarvalho ", "*.sql", SearchOption.AllDirectories);
For those of you who want to know how I solved the problem, it's the following:
string path = "C:\Users\anacarvalho\Desktop\Teste";
string[] sqlFilesLocation = Directory.GetFiles(path, "*.sql", SearchOption.AllDirectories);