C# Program to Check the Information of the File
Given a file, now our task is to view the information of this file through C#. So to do this task we use FileInfo class. This class provides different types of properties and methods for creating, copying, deleting, opening, and moving files. It is also, used for creating FileStream objects. So here we create an object of the FileInfo class which contains the file name.
FileInfo info = new FileInfo("C:\\sravan\\data.txt");
In this example, we consider a file named ” data.txt” present in the “sravan” folder in the C drive or “C:\\sravan\\data.txt”. Now with the help of this path, we will find the information of “data.txt” file using the Attributes property. This property returns an enumerated constant which is encoded as enum flag.
Attribute of the File is Archive