File (system. Io namespace)

Source: Internet
Author: User

In C #, we often need to operate on files. Of course, there are many file types. Here I will focus on the class used for input and output.

1. Stream: All Input and Output tasks in. NET Framework must use a stream. Stream is an abstract representation of serialized devices.
2. system. Io namespace
File: provides many static methods for moving, copying, and deleting files.
Directory: provides many static methods for moving, copying, and deleting directories.
Fileinfo: indicates a physical file on the disk. It can process this file. to read and write the file, you must create a stream object.
Directoryinfo: indicates the physical directory on the disk, which can be processed.
Filestream: indicates a file that can be written, read, or both. This file can be read and written synchronously or asynchronously.
Streamreader: reads character data from a stream and can be created as the base class by using filestream.
Streamwriter: Write character data to a stream. You can use filestream to create a base class.
Filesystemwatcher: used to monitor files and directories and give applications when these locations changeProgramEvents that can be captured.

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.