zoukankan      html  css  js  c++  java
  • 系列4:文件操作以及读写文件

    1。文件或者目录操作可以用到FileInfo,File,DirectoryInfo,Directory类:

    FileInfo和File的主要区别是File的多数方法都是静态方法,DirectoryInfo与Directory区别与此相似。

    2。流:In the world of I/O
    manipulation, a stream represents a chunk of data. Streams provide a common way to interact with
    a sequence of bytes, regardless of what kind of device (file, network connection, printer, etc.) is storing
    or displaying the bytes in question.

    在实际操作中,我们很少直接使用FileStream,因为它只接受直接数组类型的数据。取而代之的我们使用StreamReader, and StreamWriter这对对FileStream更好的包装。

    3。Reader 和 Writer对:

    Using the StringWriter and StringReader types, you can treat textual information as a stream of
    in-memory characters. This can prove helpful when you wish to append character-based information
    to an underlying buffer.

     4代码例子:

    Code
  • 相关阅读:
    Js判断是否改动
    导入用户数据到Discuz! X3.2 并实现同步登陆
    win2003(sp2 x86)+iis6+php-5.3.5-Win32 配置
    bblittle.com
    Macbook Hbase(1.2.6) 伪分布式安装,Hadoop(2.8.2) ,使用自带zookeeper
    LeetCode 696. Count Binary Substrings
    LeetCode 637. Average of Levels in Binary Tree
    LeetCode 226. Invert Binary Tree
    LeetCode 669. Trim a Binary Search Tree
    LeetCode 575. Distribute Candies
  • 原文地址:https://www.cnblogs.com/engine1984/p/1442033.html
Copyright © 2011-2022 走看看