Document management File Class

Source: Internet
Author: User

Document management File Class

In the previous lecture, we learned about several types of generic collections, and today we mainly study the basic use of file.

First, the file class is a static class and cannot be instantiated. Its namespace is: using System.IO

The basic method in file is shown below:

Figure I, File.create

Figure II, File.Copy general situation

Figure III, File.Copy (PATH,PATH1,TRUE);

Figure IV, File.delete

Figure V, file.exists ();

Figure VI, File.move

Figure VII, File.ReadAllLines ()

Figure VIII, the difference between ReadAllText and ReadAllLines

Fig. Nine or one simple exercises

Figure X, File.replace

Figure 11, File.writealllines ()

Figure 12, File.writealltext ()

Figure 13, File.appendalllines ()

Figure 14, File.appendalltext ()

Above, we summarize the methods in the file files. What I want to say is that in practice it is the project. These basic methods will help us. The so-called, do not accumulate kuibu, not even thousands of miles. Flexible use, one is more practice, another need to pay attention to the need for more summary.

Here's how to create a folder and more.

Figure 15, Directory.CreateDirectory

Figure 16, Directory.Exists

Figure 17, Directory.getcreationtime

Figure 18, Directory.GetCurrentDirectory

Figure 19, Directory.GetFiles ()

Figure 20, Directory.move

Document management File 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.