Directories in C #

3

I have several .Sql files in this directory: C:\Users\anacarvalho\Desktop\Teste How do I get all these files?

    
asked by anonymous 19.04.2017 / 13:55

2 answers

3

Use the Directory.GetFiles with the search option in all directories

var Arquivos= Directory.GetFiles(@"C:\Users\anacarvalho ", "*.sql", SearchOption.AllDirectories);
    
19.04.2017 / 14:07
0

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);
    
26.06.2017 / 12:53