源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

FileStreaReder和StreamReader两个类介绍

  • 时间:2022-08-10 20:24 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:FileStreaReder和StreamReader两个类介绍
好吧,先上图: [img]http://files.jb51.net/upload/201204/20120419185132727.jpg[/img] 这里是TextReder类官方的解释:([url=http://msdn.microsoft.com/zh-cn/library/system.io.textreader.aspx]http://msdn.microsoft.com/zh-cn/library/system.io.textreader.aspx[/url]) Peek and Read methods to make a useful instance of TextReader.">这里是Stream类官方的解释:([url=http://msdn.microsoft.com/zh-cn/library/system.io.stream.aspx]http://msdn.microsoft.com/zh-cn/library/system.io.stream.aspx[/url]) Peek and Read methods to make a useful instance of TextReader.">我们要使用的FileStream和StreamReader这两个类。那好,我们再来看看他们MSDN是怎么描述这个类的吧! Peek and Read methods to make a useful instance of TextReader.">首先来看看FileStream([url=http://msdn.microsoft.com/zh-cn/library/system.io.filestream.aspx]http://msdn.microsoft.com/zh-cn/library/system.io.filestream.aspx[/url])类在MSDN上的描述如下: FileStream class to read from, write to, open, and close files on a file system, as well as to manipulate other file-related operating system handles including pipes, standard input, and standard output." id="mt62">使用 FileStream 类对文件系统上的文件进行读取、写入、打开和关闭操作,并对其他与文件相关的操作系统句柄进行操作,如管道、标准输入和标准输出。 可以指定读写操作是同步还是异步。 FileStream buffers input and output for better performance." id="mt64">FileStream 缓冲输入和输出以获得更好的性能。--部分内容以删简 FileStream buffers input and output for better performance.">再来看看StreamReader([url=http://msdn.microsoft.com/zh-cn/library/system.io.streamreader.aspx]http://msdn.microsoft.com/zh-cn/library/system.io.streamreader.aspx[/url])类在MSDN上的描述如下: StreamReader is designed for character input in a particular encoding, whereas the Stream class is designed for byte input and output." id="mt36">StreamReader 旨在以一种特定的编码输入字符,而 [url=http://msdn.microsoft.com/zh-cn/library/system.io.stream.aspx]Stream[/url] 类用于字节的输入和输出。 StreamReader for reading lines of information from a standard text file." id="mt37">使用 StreamReader 读取标准文本文件的各行信息。 StreamReader defaults to UTF-8 encoding unless specified otherwise, instead of defaulting to the ANSI code page for the current system." id="mt38">除非另外指定,StreamReader 的默认编码为 UTF-8,而不是当前系统的 ANSI 代码页。 UTF-8 可以正确处理 Unicode 字符并在操作系统的本地化版本上提供一致的结果。 StreamReader is not thread safe." id="mt40">默认情况下,StreamReader 不是线程安全的。 TextReader.Synchronized for a thread-safe wrapper." id="mt41">有关线程安全包装的信息,请参见 [url=http://msdn.microsoft.com/zh-cn/library/system.io.textreader.synchronized.aspx]TextReader.Synchronized[/url]。--FileStream buffers input and output for better performance." id="mt64">部分内容以删简 FileStream buffers input and output for better performance."> 从这两个描述的对比来看我们就知道了FileStream主要是操作FileStream class to read from, write to, open, and close files on a file system, as well as to manipulate other file-related operating system handles including pipes, standard input, and standard output." id="mt62">文件系统上的文件,那么什么又是文件系统呢,按照我的理解就是存在于网络上的文件。 FileStream class to read from, write to, open, and close files on a file system, as well as to manipulate other file-related operating system handles including pipes, standard input, and standard output.">那么StreamReader它只是StreamReader for reading lines of information from a standard text file." id="mt37">读取标准文本文件的各行信息,我的理解就是操作本地文本文件的内容。 StreamReader for reading lines of information from a standard text file.">那好,我们已经认识了这两个文件是做什么的,那么我们才能知道在什么时候去使用。具体的使用整理后在贴出来。以便以后方便使用。
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部