Edit

Share via


OpenAccess Enum

Definition

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

C#
public enum OpenAccess
Inheritance
OpenAccess

Fields

Name Value Description
Default -1

Read and write access permitted. This is the default.

Read 1

Read access permitted.

Write 2

Write access permitted.

ReadWrite 3

Read and write access permitted.

Remarks

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

The OpenAccess enumeration defines constants used to identify whether a file can be read from (Read), written to (Write), or both (ReadWrite). A file opened for Read access cannot be modified, only read from. The following table lists the OpenAccess enumeration members.

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

Applies to

Product Versions
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also