This documentation is archived and is not being maintained.

File Handling Changes in Visual Basic

Visual Basic .NET expands file-handling capabilities while providing compatibility with previous versions of Visual Basic file I/O functions.

Visual Basic 6.0

In Visual Basic 6.0, file handling is accomplished using various file I/O functions such as Open, Input, Output, and Append. The File System Object provides an object-oriented method of working with files.

Visual Basic .NET

In Visual Basic .NET, file handling is accomplished through the System.IO namespace, which duplicates and expands upon the File System Object. In addition, the System.IO.File namespace includes functions that provide compatibility with the older Visual Basic file I/O functions.

The FileStream class provides access to standard input and output files and error devices.

The following table lists file-related enumerations available in Visual Basic .NET.

Enumeration Purpose
FileAccess Enumeration Defines constants for read, write, or read/write access to a file
FileMode Enumeration Specifies how the operating system opens a file
FileShare Enumeration Provides constants for controlling the level of access other FileStream members have to the same file
FileAttributes Enumeration Provides access to stored attributes, such as whether a file is a directory, is encrypted, hidden, or read-only, or is a system file or a temporary file

See Also

Processing Drives, Folders, and Files | File Access Through StreamReader and StreamWriter Classes | File Access Types, Functions, and Statements | System.IO Namespace | File Class | FileStream Class | FileAccess Enumeration | FileMode Enumeration | FileShare Enumeration | FileAttributes Enumeration | Programming Element Support Changes Summary