Marv
Marv

Reputation: 153

'System.IO.Directory' does not contain a definition for 'EnumerateFiles'

habe a problem, I developed a program with .NET 4 Framework but I have to switch to 3.5 (VS 2008) - but in 3.5 is EnumerateFiles not included. What I can use for this ?

I use it here:

var txtFiles = Directory.EnumerateFiles(folder_pfad, "*.txt", SearchOption.TopDirectoryOnly);

Thanks.

Upvotes: 5

Views: 3997

Answers (1)

Kevin
Kevin

Reputation: 4636

I think this will work...

s = Directory.GetFiles(folder_pfad, "*.txt", SearchOption.TopDirectoryOnly);

Upvotes: 5

Related Questions