C# DirectoryInfo Attributes

Description

DirectoryInfo Attributes Gets or sets the attributes for the current file or directory.

Syntax

DirectoryInfo.Attributes has the following syntax.


public FileAttributes Attributes { get; set; }

Example

Gets the attributes for the current file or directory.


// w  w w.ja  v  a 2 s .co m
using System;
using System.IO;

class Class1
{
   public static void Main(){
      DirectoryInfo  target = new DirectoryInfo("c:/abc");
      Console.WriteLine(target.Attributes);
   }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.IO »




BinaryReader
BinaryWriter
Directory
DirectoryInfo
DriveInfo
File
FileInfo
FileStream
MemoryStream
Path
StreamReader
StreamWriter
StringReader
StringWriter