http://msdn.microsoft.com/zh-cn/library/aa497275.aspx
使用 System.IO.FileInfo 类来访问文件属性。
![ContractedBlock.gif](http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
![ExpandedBlockStart.gif](http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
System.IO.FileInfo fi = new System.IO.FileInfo("filename");
// remove readonly attribute
if ((fi.Attributes & System.IO.FileAttributes.ReadOnly) != 0)
fi.Attributes -= System.IO.FileAttributes.ReadOnly;
System.IO.File.Delete("filename");
--------------------------------------------------
李森 – listen |
声明: Announce: |