C# FileInfo文件移除属性

 FileInfo fileInfo = new FileInfo(fileName);

 
//判断文件是否存在该属性
 if ((fileInfo.Attributes & FileAttributes.System) == FileAttributes.System)
       fileInfo.Attributes 
&= ~FileAttributes.System;
 fileInfo.Attributes 
&= ~FileAttributes.Hidden & ~FileAttributes.NotContentIndexed & ~FileAttributes.ReadOnly;
posted @ 2011-03-27 15:02  MrNobody_123456  阅读(295)  评论(0编辑  收藏  举报