Opens a file on the specified path, having the specified mode with read, write, or read/write access and the specified sharing option.
[Visual Basic] Overloads Public Shared Function Open( _ ByVal path As String, _ ByVal mode As FileMode, _ ByVal access As FileAccess, _ ByVal share As FileShare _ ) As Stream [C#] public static Stream Open( string path, FileMode mode, FileAccess access, FileShare share ); [C++] public: static Stream* Open( String* path, FileMode mode, FileAccess access, FileShare share ); [JScript] public static function Open( path : String, mode : FileMode, access : FileAccess, share : FileShare ) : Stream;
A file on the specified path, having the specified mode with read, write, or read/write access and the specified sharing option.
Exception Type | Condition |
---|---|
SecurityException | The caller does not have the required permission. |
ArgumentException | path is empty or contains only whitespaces. |
NGWS Runtime Security:
FileIOPermissionAccess | Read permission to the path. |
File Class | File Members | System.IO Namespace | File.Open Overload List