C#判断目录是否为隐藏

判断方法:

DirectoryInfo di = new DirectoryInfo(path);
if ((di.Attributes & FileAttributes.Hidden) == FileAttributes.Hidden)
          //为隐藏的

同理可以判断目录是否为只读(ReadOnly)或者系统(System)等其他属性。

原文地址:https://www.cnblogs.com/visionfeng/p/6069102.html