I have this loop:
foreach (DirectoryInfo dir in downloadedMessageInfo.GetDirectories()) { if (dir.Attributes != FileAttributes.Hidden) { dir.Delete(true); } }
How can I correctly skip all hidden directories?
In .NET 4.0 you can do:
dir.Attributes.HasFlag(FileAttributes.Hidden)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With