File Access with Visual Basic

 

Updated: July 20, 2015

For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.

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.

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.

Show: