I managed to get the files from the "root" subdirectories, but I also get the files from these subdirectories2, which I donβt want.
Example: RootDirectory>Subdirectories (wanted files)>directories2 (unwanted files)
I used this code:
public void ReadDirectoryContent() { var s1 = Directory.GetFiles(RootDirectory, "*", SearchOption.AllDirectories); { for (int i = 0; i <= s1.Length - 1; i++) FileInfo f = new FileInfo(s1[i]); . . . etc } }
anzes source share