Export (0) Print
Expand All

OpenMode Enumeration

Indicates how to open a file when calling file-access functions.

Namespace: Microsoft.VisualBasic
Assembly: Microsoft.VisualBasic (in microsoft.visualbasic.dll)

public enum OpenMode
public enum OpenMode
public enum OpenMode

 Member nameDescription
AppendFile opened to append to it. Default. 
BinaryFile opened for binary access. 
InputFile opened for read access. 
OutputFile opened for write access. 
RandomFile opened for random access. 

For more detailed information, see the Visual Basic topic OpenMode Enumeration.

When you call file access–related functions, you can use enumeration members in your code instead of the actual values.

The OpenMode enumeration defines constants used to set file access modes. The following table lists the OpenMode enumeration members.

Input, Output, and Append are used when sequentially accessing files, such as text files, whereas Binary is used for binary file access and Random for random file access.

When sequentially accessing a file, you cannot change its data. You can read the data, append to it, or overwrite it with new data. If you open it for input, the contents of the file will be overwritten, even if you do not directly write to the file.

When performing file I/O operations, the My.Computer.FileSystem object provides better performance and ease of use than earlier file I/O methods. For more information, see My.Computer.FileSystem Object.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft