The base classes of the DirectoryInfo class and the FileInfo class are FileSystemInfo classes, which is an abstract class, that is, you cannot instantiate the class, but can only produce its subclasses through inheritance and instantiate its subclasses. However, you can apply the various attributes defined by the class, and the table below shows the various properties that the class has defined.
Table 2
The DirectoryInfo class provides methods for creating, deleting, and moving directories, and to use the various properties in table 2, we first have to create an object of the DirectoryInfo class, and then we can access its various properties.
At the same time, we can use the FileAttributes enumeration type value to get various properties related to the file, and the table below shows the various values in that enumeration type.
Table 3
C # uses DirectoryInfo class and FileInfo class