好吧,先上图:

FileStreaReder和StreamReader两个类介绍

这里是TextReder类官方的解释:(http://msdn.microsoft.com/zh-cn/library/system.io.textreader.aspx)

Peek and Read methods to make a useful instance of TextReader. '>这里是Stream类官方的解释:(http://msdn.microsoft.com/zh-cn/library/system.io.stream.aspx)

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(http://msdn.microsoft.com/zh-cn/library/system.io.filestream.aspx)类在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.'>使用 FileStream 类对文件系统上的文件进行读取、写入、打开和关闭操作,并对其他与文件相关的操作系统句柄进行操作,如管道、标准输入和标准输出。 可以指定读写操作是同步还是异步。 FileStream buffers input and output for better performance.'>FileStream 缓冲输入和输出以获得更好的性能。--部分内容以删简

FileStream buffers input and output for better performance.'>再来看看StreamReader(http://msdn.microsoft.com/zh-cn/library/system.io.streamreader.aspx)类在MSDN上的描述如下:

StreamReader is designed for character input in a particular encoding, whereas the Stream class is designed for byte input and output.'>StreamReader 旨在以一种特定的编码输入字符,而 Stream 类用于字节的输入和输出。 StreamReader for reading lines of information from a standard text file.'>使用 StreamReader 读取标准文本文件的各行信息。

StreamReader defaults to UTF-8 encoding unless specified otherwise, instead of defaulting to the ANSI code page for the current system.'>除非另外指定,StreamReader 的默认编码为 UTF-8,而不是当前系统的 ANSI 代码页。 UTF-8 可以正确处理 Unicode 字符并在操作系统的本地化版本上提供一致的结果。

StreamReader is not thread safe.'>默认情况下,StreamReader 不是线程安全的。 TextReader.Synchronized for a thread-safe wrapper.'>有关线程安全包装的信息,请参见 TextReader.Synchronized。--FileStream buffers input and output for better performance.'>部分内容以删简
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.'>文件系统上的文件,那么什么又是文件系统呢,按照我的理解就是存在于网络上的文件。

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.'>读取标准文本文件的各行信息,我的理解就是操作本地文本文件的内容。

StreamReader for reading lines of information from a standard text file.'>那好,我们已经认识了这两个文件是做什么的,那么我们才能知道在什么时候去使用。具体的使用整理后在贴出来。以便以后方便使用。

标签:
FileStreaReder,StreamReader

免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
白云城资源网 Copyright www.dyhadc.com

评论“FileStreaReder和StreamReader两个类介绍”

暂无“FileStreaReder和StreamReader两个类介绍”评论...

《魔兽世界》大逃杀!60人新游玩模式《强袭风暴》3月21日上线

暴雪近日发布了《魔兽世界》10.2.6 更新内容,新游玩模式《强袭风暴》即将于3月21 日在亚服上线,届时玩家将前往阿拉希高地展开一场 60 人大逃杀对战。

艾泽拉斯的冒险者已经征服了艾泽拉斯的大地及遥远的彼岸。他们在对抗世界上最致命的敌人时展现出过人的手腕,并且成功阻止终结宇宙等级的威胁。当他们在为即将于《魔兽世界》资料片《地心之战》中来袭的萨拉塔斯势力做战斗准备时,他们还需要在熟悉的阿拉希高地面对一个全新的敌人──那就是彼此。在《巨龙崛起》10.2.6 更新的《强袭风暴》中,玩家将会进入一个全新的海盗主题大逃杀式限时活动,其中包含极高的风险和史诗级的奖励。

《强袭风暴》不是普通的战场,作为一个独立于主游戏之外的活动,玩家可以用大逃杀的风格来体验《魔兽世界》,不分职业、不分装备(除了你在赛局中捡到的),光是技巧和战略的强弱之分就能决定出谁才是能坚持到最后的赢家。本次活动将会开放单人和双人模式,玩家在加入海盗主题的预赛大厅区域前,可以从强袭风暴角色画面新增好友。游玩游戏将可以累计名望轨迹,《巨龙崛起》和《魔兽世界:巫妖王之怒 经典版》的玩家都可以获得奖励。