Set File Attributes in C#
The System.IO namespace contains types that allow reading and writing to files and data streams, and types that provide basic file and directory support.
Use the FileInfo class for typical operations such as copying, moving, renaming, creating, opening, deleting, and appending to files. FileSystemInfo.Attributes property is used to gets or sets the attributes for the current file or directory.
_file.Attributes = System.IO.FileAttributes.Hidden;
The following C# program shows how to set readonly and hidden property to a file .
- How to use C# Directory Class
- How to use C# File Class
- How to use C# FileStream Class
- How to use C# Textreader Class
- A simple C# Text Reader source code
- How to use C# TextWriter Class
- How to use C# BinaryWriter Class
- How to use C# BinaryReader Class
- How to convert XPS file to Bitmap
- How to C# Path Class
- How to create a pdf file in C#
- How to create PDF file from Text file
- Write Database data to pdf file