日期:2014-05-17 浏览次数:20966 次
Type type = typeof(System.IO.FileAttributes);
Console.WriteLine("values\tattributes");
Console.WriteLine("-----------------------------");
foreach (int value in Enum.GetValues(type))
{
Console.WriteLine("{0}\t{1}",
value, Enum.GetName(type, value));
}
Console.WriteLine("-----------------------------");
foreach (var drive in System.IO.DriveInfo.GetDrives())
{
if (drive.DriveType == System.IO.DriveType.Fixed)
{
System.IO.DirectoryInfo[] folders =
drive.RootDirectory.GetDirectories("*recycle*");
foreach (var folder in folders)
{
Console.Write("({0})\t",
(folder.Attributes & System.IO.FileAttributes.Directory)
== System.IO.FileAttributes.Directory &&
(folder.Attributes & System.IO.FileAttributes.Hidden)
== System.IO.FileAttributes.Hidden &&