ArchiveFile Property

The name of the zip, gzip, tar, or jar archive.

Syntax

public string ArchiveFile { get; set; }
Public Property ArchiveFile As String

Default Value

""

Remarks

This property specifies the name of the archive to be read or written. This property is required when extracting files.

When Scan, Extract, or ExtractAll is invoked, the file specified by ArchiveFile will be opened for read. If the file does not exist, a trappable error will be generated.

When Compress is called, the file named by ArchiveFile will be written; if a file of this name already exists the Overwrite event will be fired. If ArchiveFile is set to the empty string (""), the archive will not be written to disk, and will be provided only through the Progress event.

The filename may be specified with or without a path. Paths may be relative or absolute, and should be specified in the format native to the host operating system. The filename should be specified with the appropriate extension (such as "zip"); an extension will not automatically be appended by the component.

If the file cannot be read, or written, as appropriate, a trappable error will be generated.

Example (Creating an Archive)


ZipControl.ArchiveFile = "c:\test.zip"
ZipControl.RecurseSubdirectories = true
ZipControl.IncludeFiles("c:\foo\*")
ZipControl.Compress()

Note: an archive already open for read may be closed by setting ArchiveFile to the empty string ("").

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks ZIP 2020 .NET Edition - Version 20.0 [Build 8300]