[Root] / Xceed.Zip Assembly / Xceed.Zip Namespace / ZippedFile Class / DoOpenWrite Method / DoOpenWrite(FileSystemEventsSession,Boolean,FileShare,AbstractFile,Boolean,Stream,CompressionMethod,CompressionLevel,String,EncryptionMethod,Int32) Method
A reference to a Xceed.FileSystem.FileSystemEventsSession object which is responsible for raising all events that occur during the process.
true if existing data for the file should be replaced; false if existing data should be preserved, appending new data at the end.
A System.IO.FileShare constant that determines how the file will be shared by different processes.
The CompressionMethod that will be used to compress the file.
The CompressionLevel that will be used when compressing the file.
The password used to encrypt the file.
The EncryptionMethod used to encrypt the file.
The encryption strength used to encrypt the file. Encryption strength only applies when EncryptionMethod.WinZipAes is used.


In This Topic
    DoOpenWrite(FileSystemEventsSession,Boolean,FileShare,AbstractFile,Boolean,Stream,CompressionMethod,CompressionLevel,String,EncryptionMethod,Int32) Method
    In This Topic
    Opens the file for writing with the specified System.IO.FileShare constant, and the specified encryption method, password and strength.
    Syntax
    'Declaration
     
    
    Protected Overloads Overridable Function DoOpenWrite( _
       ByVal session As FileSystemEventsSession, _
       ByVal overwrite As Boolean, _
       ByVal share As FileShare, _
       ByVal sourceFileHint As AbstractFile, _
       ByVal openPhysicalStreamOnly As Boolean, _
       ByVal outputStream As Stream, _
       ByVal compressionMethod As CompressionMethod, _
       ByVal compressionLevel As CompressionLevel, _
       ByVal encryptionPassword As String, _
       ByVal encryptionMethod As EncryptionMethod, _
       ByVal encryptionStrength As Integer _
    ) As Stream
    'Usage
     
    
    Dim instance As ZippedFile
    Dim session As FileSystemEventsSession
    Dim overwrite As Boolean
    Dim share As FileShare
    Dim sourceFileHint As AbstractFile
    Dim openPhysicalStreamOnly As Boolean
    Dim outputStream As Stream
    Dim compressionMethod As CompressionMethod
    Dim compressionLevel As CompressionLevel
    Dim encryptionPassword As String
    Dim encryptionMethod As EncryptionMethod
    Dim encryptionStrength As Integer
    Dim value As Stream
     
    value = instance.DoOpenWrite(session, overwrite, share, sourceFileHint, openPhysicalStreamOnly, outputStream, compressionMethod, compressionLevel, encryptionPassword, encryptionMethod, encryptionStrength)

    Parameters

    session
    A reference to a Xceed.FileSystem.FileSystemEventsSession object which is responsible for raising all events that occur during the process.
    overwrite
    true if existing data for the file should be replaced; false if existing data should be preserved, appending new data at the end.
    share
    A System.IO.FileShare constant that determines how the file will be shared by different processes.
    sourceFileHint
    openPhysicalStreamOnly
    outputStream
    compressionMethod
    The CompressionMethod that will be used to compress the file.
    compressionLevel
    The CompressionLevel that will be used when compressing the file.
    encryptionPassword
    The password used to encrypt the file.
    encryptionMethod
    The EncryptionMethod used to encrypt the file.
    encryptionStrength
    The encryption strength used to encrypt the file. Encryption strength only applies when EncryptionMethod.WinZipAes is used.

    Return Value

    A System.IO.Stream object that can be used to write data to the file.
    Remarks

    The returned stream is guaranteed to be writable, but may or may not be seekable.

    If there is no existing data, the parameter overwrite is ignored.

    Supported Frameworks

    .NET: net5.0, net5.0-windows, net6.0, net6.0-macos, net6.0-windows, net7.0, net7.0-macos, net7.0-windows, net8.0, net8.0-browser, net8.0-macos, net8.0-windows, net9.0, net9.0-browser, net9.0-macos, net9.0-windows, net10.0, net10.0-browser, net10.0-macos, net10.0-windows.

    .NET Standard: netstandard2.0, netstandard2.1

    .NET Framework: net20, net35, net40, net403, net45, net451, net452, net46, net461, net462, net463, net47, net471, net472, net48, net481.

    See Also