FileStream Constructor (String, FileMode)
Assembly: mscorlib (in mscorlib.dll)
path is an empty string (""), contains only white space, or contains one or more invalid characters.
path refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in an NTFS environment.
path refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in a non-NTFS environment.
path is null.
The caller does not have the required permission.
The file cannot be found, such as when mode is FileMode.Truncate or FileMode.Open, and the file specified by path does not exist. The file must already exist in these modes.
An I/O error occurs, such as specifying FileMode.CreateNew and the file specified by path already exists.
The stream has been closed.
The specified path is invalid, such as being on an unmapped drive.
The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.
mode contains an invalid value.
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.
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.