VintaSoft Imaging .NET SDK 12.4: Documentation for .NET developer
Vintasoft.Data Namespace / FileManager Class / OpenFile(String,FileAccess) Method
Syntax Exceptions Remarks Requirements SeeAlso
In This Topic
    OpenFile(String,FileAccess) Method (FileManager)
    In This Topic
    Opens an existing file with the specified access mode.
    Syntax
    'Declaration
    
    Public Shared Function OpenFile( _
    ByVal filePath
    An absolute path to a file.
    As System.String, _
    ByVal fileAccess
    A constant that defines how the file can be accessed.
    As System.IO.FileAccess _
    ) As System.IO.FileStream
    public static System.IO.FileStream OpenFile(
    System.String filePath,
    System.IO.FileAccess fileAccess
    )
    public: static System.IO.FileStream* OpenFile(
    System.String filePath,
    System.IO.FileAccess fileAccess
    )
    public:
    static System.IO.FileStream^ OpenFile(
    System.String filePath,
    System.IO.FileAccess fileAccess
    )

    Parameters

    filePath
    An absolute path to a file.
    fileAccess
    A constant that defines how the file can be accessed.

    Return Value

    File stream.
    Exceptions
    ExceptionDescription
    Thrown if file must be opened but file is not found.
    Thrown if file must be created but file exists already.
    Thrown if file is locked.
    Remarks

    The method will create new file if fileAccess is set to System.IO.FileAccess.Write; otherwise, the method will open a file.

    Requirements

    Target Platforms: .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    See Also