C # uses DirectoryInfo class and FileInfo class

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.