从文件读取 (Visual Basic)Reading from Files in Visual Basic

本节说明如何执行与读取文件相关的任务。This section explains how to perform tasks that are associated with reading from files.

本节内容In This Section

如何:读取文本文件How to: Read from Text Files
演示如何从文本文件中读取数据。Demonstrates how to read from a text file.

如何:读取逗号分隔的文本文件How to: Read From Comma-Delimited Text Files
演示如何读取带分隔符的文本文件。Demonstrates how to read from a delimited text file.

如何:读取固定宽度的文本文件How to: Read From Fixed-width Text Files
演示如何读取定宽文本文件。Demonstrates how to read from a fixed-width text file.

如何:读取具有多种格式的文本文件How to: Read From Text Files with Multiple Formats
演示如何读取具有多种格式的文本文件。Demonstrates how to read from a text file with multiple formats.

如何:读取二进制文件How to: Read From Binary Files
演示如何读取二进制文件。Demonstrates how to read from a binary file.

如何:使用 StreamReader 读取文件中的文本How to: Read Text from Files with a StreamReader
演示如何使用 StreamReader 读取文件。Demonstrates how to use a StreamReader to read from a file.

参考Reference

FileSystem
介绍 My.Computer.FileSystem 对象及其成员。Describes the My.Computer.FileSystem object and its members.

ReadAllText
介绍 ReadAllText 方法。Describes the ReadAllText method.

ReadAllBytes
介绍 ReadAllBytes 方法。Describes the ReadAllBytes method.

OpenTextFieldParser
介绍 OpenTextFieldParser 方法。Describes the OpenTextFieldParser method.

OpenTextFileReader
介绍 OpenTextFileReader 方法。Describes the OpenTextFileReader method.

将数据存储到剪贴板以及从剪贴板读取数据Storing Data to and Reading from the Clipboard
解释如何执行与 My.Computer.Clipboard 相关联的任务,例如从剪贴板读取数据或向剪贴板写入数据。Explains how to perform tasks that are associated with My.Computer.Clipboard, such as reading data from or writing data to the Clipboard.

使用 TextFieldParser 对象分析文本文件Parsing Text Files with the TextFieldParser Object
提供用 TextFieldParser 对象读取文本文件的概述。Provides an overview of reading text files with the TextFieldParser object.

演练:在 Visual Basic 中操作文件和目录Walkthrough: Manipulating Files and Directories in Visual Basic
演示如何将 My 功能用于文件和目录。Demonstrates how to use the My feature with files and directories.

演练:使用 .NET Framework 方法操作文件Walkthrough: Manipulating Files by Using .NET Framework Methods
演示如何将 .NET Framework 方法用于文件和目录。Demonstrates how to use .NET Framework methods with files and directories.