FileStream Constructor (String, FileMode, FileAccess, FileShare, Int32)
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Initializes a new instance of the FileStream class with the specified path, creation mode, read/write and sharing permission, and buffer size.
Assembly: System.IO (in System.IO.dll)
public FileStream( string path, FileMode mode, FileAccess access, FileShare share, int bufferSize )
- Type: System..::..String
A relative or absolute path for the file that the current FileStream object will encapsulate.
- Type: System.IO..::..FileMode
A constant that determines how to open or create the file.
- Type: System.IO..::..FileAccess
A constant that determines how the file can be accessed by the FileStream object. This gets the CanRead and CanWrite properties of the FileStream object. CanSeek is true if path specifies a disk file.
- Type: System.IO..::..FileShare
A constant that determines how the file will be shared by processes.
CanSeek is true for all FileStream objects that encapsulate files. If path indicates a device that does not support seeking, the CanSeek property on the resulting FileStream is false. For additional information, see CanSeek.
When you compile a set of characters with a particular cultural setting and retrieve those same characters with a different cultural setting, the characters might not be interpretable, and could cause an exception to be thrown.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.