Realize: What is record dealing within C#.Net? What are streams, kind of streams, fundamental document activities and classes are utilized for record tasks?
What is a file in C#?
The document/file is an assortment of information, which has one of a kind name and stores information in an explicit way. At the point when we open a document for perusing or composing, it is known as a stream.
What is Stream?
The stream is an arrangement of bytes. There are two kinds of streams are utilized:
- Information stream
- This stream is utilized to peruse information from the document, which is known as a reading activity.
- Output stream
- This stream is utilized to compose information into the record, which is known as compose activity.
Namespace to use for document tasks
In C#, System.IO namespace is utilized to perform document tasks.
There are following document tasks utilized in C#:
- Making of record
- Cancellation of record
- Perusing information from document
- Composing information into document
- Affixing information into record
- Opening a document
- Shutting a document and so forth…
There are following classes are utilized document dealing with in C#:
- BinaryReader
- BinaryWriter
- BufferedStream
- Index
- DirectoryInfo
- DriveInfo
- Document
- FileInfo
- FileStream
- MemoryStream
- Way
- StreamReader
- StreamWriter
- StringReader
- StringWriter
There are following document modes utilized in C#:
- Open
- Make
- CreateNew
- OpenOrCreate
- Affix
- Shorten