C#判断目录是否为隐藏

判断方法:

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

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

posted @ 2016-11-16 12:58  Dean-Feng  阅读(1809)  评论(0编辑  收藏  举报
Bolg of 冯广乐