System.IO.FileSystemInfo.Attributes Property

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

Syntax

public FileAttributes Attributes { get; set; }

Value

Documentation for this section has not yet been entered.

Remarks

The value of the FileSystemInfo.Attributes property is pre-cached if the current instance of the System.IO.FileSystemInfo object was returned from any of the following System.IO.DirectoryInfo methods:

To get the latest value, call the FileSystemInfo.Refresh method.

The value of this property is a combination of the archive, compressed, directory, hidden, offline, read-only, system, and temporary file attribute flags.

When you set this value, use the bitwise OR operator (| in C# or Or in Visual Basic) to apply more than one value. To retain any existing values in the FileSystemInfo.Attributes property, include the value of the FileSystemInfo.Attributes property in your assignment. For example:

exampleFile.Attributes = exampleFile.Attributes | FileAttributes.ReadOnly;

Requirements

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0