File Handling Changes in Visual Basic

 

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.a

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