File Access with Visual Basic

The My.Computer.FileSystem object provides tools for working with files and folders. Its properties, methods, and events allow you to create, copy, move, investigate, and delete files and folders. My.Computer.FileSystem provides better performance than the legacy functions (FileOpen, FileClose, Input, InputString, LineInput, etc.) that are provided by Visual Basic for backward compatibility.

In This Section

Reading from Files
Lists topics dealing with using the My.Computer.FileSystem object to read from files

Writing to Files
Lists topics dealing with using the My.Computer.FileSystem object to write to files

Creating, Deleting, and Moving Files and Directories
Lists topics dealing with using the My.Computer.FileSystem object to creating, copying, deleting and moving files and folders.

Parsing Text Files with the TextFieldParser Object
Discusses how to use the TextFieldReader to parse text files such as logs.

File Encodings
Describes file encodings and their use.

Walkthrough: Manipulating Files and Directories in Visual Basic
Demonstrates how to create a utility that reports information about files and folders.

Troubleshooting: Reading from and Writing to Text Files
Lists common problems encountered when reading and writing to text files, and suggests remedies for each.