I have developed an application that you enter a directory and it gives you the 10 biggest files in that location. I want to give users the ability to even do this on c:/. But with that i get an exception whenever the application tries to enter a something like c:\Program Files\WindowsApps. Below is my query. Ive tried certain ways of cantains etc. But seem to be stumped.
var subDirectories = dirInfo.GetDirectories().Where(d => (d.Attributes & FileAttributes.System) == 0);