FileAttributes.Hidden == 0 &&
FileAttributes.System == 0 &&
FileAttributes.Temporary == 0 &&
This is testing that the enumeration values are == 0, not if a file has that attribute. You need to create instances of System.IO.FileInfo
to use FileInfo.Attributes
. You can use .Select(f => new System.IO.FileInfo(f))
for this.