Differences between streamwriter and binarywriter

Source: Internet
Author: User

File Operations in C #
Many Attributes of fileinfo dir do not need to be known to everyone on earth (what filename, create () Delete ())
The file system concept is well understood.
File Reading and Writing (hard disk to memory and then to the display)
What we want to talk about is the difference between streamwriter and binarywriter.
It can be understood as follows:
Streamwriter is used to write text files.
Binary is used to write binary files.

If you use a binaryreader to read and write data using streamwriter
The next time you open a text file containing the letter A with notepad, you will see the binary format of ASC of.
After an occasional opportunity, I thought it was strange. Then I understood it.
 
In addition, if you store text files in the past, some Encoding Problems will always occur inexplicably.
This is also a problem for many cainiao on the Internet. If the file does not need to be changed, binarywriter will be easy to use.
Let all coding problems go to hell

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.