Share via


File.Open Method

Opens a FileStream on the specified path, having the specified mode with read, write, or read/write access and the specified sharing option.

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)

Syntax

public static FileStream Open (
         stringpath,
         FileModemode,
         FileAccessaccess,
         FileShareshare
)

Parameters

  • path
    The file to open.
  • mode
    A FileMode value that specifies whether a file is created if one does not exist, and determines whether the contents of existing files are retained or overwritten.
  • access
    A FileAccess value that specifies the operations that can be performed on the file.
  • share
    A FileShare value specifying the type of access other threads have to the file.

Return Value

A FileStream on the specified path, having the specified mode with read, write, or read/write access and the specified sharing option.

Version Information

Available in the .NET Micro Framework versions 3.0, 4.0, and 4.1.

See Also

Reference

File Class
File Members
System.IO Namespace