Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否引入了一种新方法来扫描 VS 2012 C# 中选择的文件的属性?例如扫描文件的属性,如只读、系统和隐藏以进行防病毒。
不,没有新方法,旧方法很好用。这是当前存在的方法的未经测试的示例
Directory.GetFiles("path").Select(file => File.GetAttributes(file) == FileAttributes.ReadOnly);