FileInfo.Open Method (FileMode, FileAccess, FileShare)
When it is called by trusted applications, opens a file in the specified mode with read, write, or read/write access and the specified sharing option.
Assembly: mscorlib (in mscorlib.dll)
- Type: System.IO.FileMode
A FileMode constant specifying the mode (for example, Open or Append) in which to open the file.
- Type: System.IO.FileAccess
A FileAccess constant specifying whether to open the file with Read, Write, or ReadWrite file access.
The caller does not have the required permission.
path is empty or contains only white spaces.
The file is not found.
One or more arguments is null.
path is read-only or is a directory.
The specified path is invalid, such as being on an unmapped drive.
The file is already open.
Silverlight for Windows PhoneThis member has a SecurityCriticalAttribute attribute on Silverlight for Windows Phone, because the attribute was present in Silverlight 3. This attribute restricts this member to internal use. Application code that uses this member throws a MethodAccessException.