public sealed class ZipArchiver : IDisposable
Public NotInheritable Class ZipArchiver
Implements IDisposable
Dim instance As ZipArchiver
public ref class ZipArchiver sealed : IDisposable
[<SealedAttribute>]
type ZipArchiver =
class
interface IDisposable
end
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
Public Class Form1 : Inherits Form
Friend WithEvents Archiver As New ZipArchiver
Private Sub Test() Handles MyBase.Shown
' Build a Zip file.
Archiver.Compress("C:\Source Folder", "C:\File.zip", CompressionMethod.None, CompressionLevel.Default, "Password", EncryptionAlgorithm.WinZipAes256)
' Build a SFX file.
Archiver.CompressSfx("C:\Source Folder", "C:\File.exe", CompressionMethod.None, CompressionLevel.Default,
extractionDirectory:=".\", silentExtraction:=True, overwriteFiles:=ExtractExistingFileAction.DoNotOverwrite,
deleteExtractedFilesAfterExtraction:=False, commandLineArgument:=Nothing,
icon:=Nothing, windowTitle:="SFX Widnow Title", windowStyle:=SelfExtractorFlavor.WinFormsApplication)
Archiver.Extract("C:\file.zip", "C:\dfsfdfsdf", ExtractExistingFileAction.DoNotOverwrite, "Password")
End Sub
Public Sub Archiver_CompressionProgressChanged(ByVal sender As Object, ByVal e As SaveProgressEventArgs) _
Handles Archiver.CompressionProgressChanged
Select Case e.EventType
Case ZipProgressEventType.Saving_Started
Console.WriteLine(String.Format("Begin creating file: {0}", e.ArchiveName))
Case ZipProgressEventType.Saving_BeforeWriteEntry
Console.WriteLine(String.Format("Writing ({1}/{2}): {0}",
e.CurrentEntry.FileName,
(e.EntriesSaved + 1),
e.EntriesTotal))
' ProgressBar2.Maximum = e.EntriesTotal ' Count of total files to compress.
' ProgressBar2.Value = (e.EntriesSaved + 1) ' Count of compressed files.
Case ZipProgressEventType.Saving_EntryBytesRead
' ProgressBar1.Value = CType((e.BytesTransferred * 100) / e.TotalBytesToTransfer, Integer) ' Total Progress.
Case ZipProgressEventType.Saving_Completed
Console.WriteLine(String.Format("Compression done: {0}", e.ArchiveName))
Case Else
' ...
End Select
End Sub
Public Sub Archiver_ExtractionProgressChanged(ByVal sender As Object, ByVal e As ExtractProgressEventArgs) _
Handles Archiver.ExtractionProgressChanged
Dim zipFileCount As Integer = DirectCast(sender, ZipFile).Entries.Count
Static extractedFileCount As Integer
Select Case e.EventType
Case ZipProgressEventType.Extracting_BeforeExtractEntry
If (extractedFileCount = 0) Then
Console.WriteLine(String.Format("Begin extracting file: {0}", e.ArchiveName))
End If
extractedFileCount += 1
Console.WriteLine(String.Format("Extracting ({1}/{2}): {0}", e.CurrentEntry.FileName, extractedFileCount, zipFileCount))
' ProgressBar1.Maximum = zipFileCount ' Count of total files to uncompress
' ProgressBar1.Value = extractedFileCount ' Count of uncompressed files
Case ZipProgressEventType.Extracting_AfterExtractEntry
If (extractedFileCount = zipFileCount) Then
Console.WriteLine(String.Format("Extraction done: {0}", e.ArchiveName))
End If
Case Else
' ...
End Select
End Sub
End Class
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
ZipArchiver | Initializes a new instance of the ZipArchiver class. |
Build(IEnumerableString, String) | Compresses the specified source files or diretories into a Zip archive using the default compression parameters. |
Build(String, String) | Compresses the specified source file or diretory into a Zip archive using the default compression parameters. |
Build(IEnumerableString, String, CompressionMethod, CompressionLevel) | Compresses the specified source files or diretories into a Zip archive using the specified compression parameters. |
Build(IEnumerableString, String, String, EncryptionAlgorithm) | Compresses the specified source files or diretories into a Zip archive, with a password, using the default compression parameters. |
Build(String, String, CompressionMethod, CompressionLevel) | Compresses the specified source file or diretory into a Zip archive using the specified compression parameters. |
Build(String, String, String, EncryptionAlgorithm) | Compresses the specified source file or diretory into a Zip archive, with a password, using the default compression parameters. |
Build(IEnumerableString, String, String, EncryptionAlgorithm, CompressionMethod, CompressionLevel) | Compresses the specified source files or diretories into a Zip archive, with a password, using the specified compression parameters. |
Build(String, String, String, EncryptionAlgorithm, CompressionMethod, CompressionLevel) | Compresses the specified source file or diretory into a Zip archive, with a password, using the specified compression parameters. |
BuildSfx(IEnumerableString, String) | Compresses the specified source files or diretories into a self-extracting archive (SFX) using the default compression parameters. |
BuildSfx(String, String) | Compresses the specified source file or diretory into a self-extracting archive (SFX) using the default compression parameters. |
BuildSfx(IEnumerableString, String, CompressionMethod, CompressionLevel) | Compresses the specified source files or diretories into a self-extracting archive (SFX) using the specified compression parameters. |
BuildSfx(IEnumerableString, String, String, EncryptionAlgorithm) | Compresses the specified source files or diretories into a self-extracting archive (SFX), with a password, using the default compression parameters. |
BuildSfx(String, String, CompressionMethod, CompressionLevel) | Compresses the specified source file or diretory into a self-extracting archive (SFX) using the specified compression parameters. |
BuildSfx(String, String, String, EncryptionAlgorithm) | Compresses the specified source file or diretory into a self-extracting archive (SFX), with a password, using the default compression parameters. |
BuildSfx(IEnumerableString, String, String, EncryptionAlgorithm, CompressionMethod, CompressionLevel) | Compresses the specified source files or diretories into a self-extracting archive (SFX), with a password, using the specified compression parameters. |
BuildSfx(String, String, String, EncryptionAlgorithm, CompressionMethod, CompressionLevel) | Compresses the specified source file or diretory into a self-extracting archive (SFX), with a password, using the specified compression parameters. |
BuildSfx(IEnumerableString, String, CompressionMethod, CompressionLevel, String, Boolean, ExtractExistingFileAction, Boolean, String, String, SelfExtractorFlavor, String) | Compresses the specified source files or diretories into a self-extracting archive (SFX), using the specified compression and SFX parameters. |
BuildSfx(String, String, CompressionMethod, CompressionLevel, String, Boolean, ExtractExistingFileAction, Boolean, String, String, SelfExtractorFlavor, String) | Compresses the specified source file or diretory into a self-extracting archive (SFX), using the specified compression and SFX parameters. |
BuildSfx(IEnumerableString, String, String, EncryptionAlgorithm, CompressionMethod, CompressionLevel, String, Boolean, ExtractExistingFileAction, Boolean, String, String, SelfExtractorFlavor, String) | Compresses the specified source files or diretories into a self-extracting archive (SFX), with a password, using the specified compression and SFX parameters. |
BuildSfx(String, String, String, EncryptionAlgorithm, CompressionMethod, CompressionLevel, String, Boolean, ExtractExistingFileAction, Boolean, String, String, SelfExtractorFlavor, String) | Compresses the specified source file or diretory into a self-extracting archive (SFX), with a password, using the specified compression and SFX parameters. |
Dispose | Releases all the resources used by this instance. |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
Extract(String, String, ExtractExistingFileAction) | Extracts the contents of the source zip archive to the specified diretory. |
Extract(String, String, ExtractExistingFileAction, String) | Extracts the encrypted contents of the source zip archive to the specified diretory. |
GetHashCode | Serves as the default hash function. (Inherited from Object) |
GetType | Gets the Type of the current instance. (Inherited from Object) |
ToString | Returns a string that represents the current object. (Inherited from Object) |
CompressionProgressChanged | Occurs when the compression progress has changed. |
ExtractionProgressChanged | Occurs when the extraction progress has changed. |
CanConvertTo |
Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions) |
CanConvertToT |
Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions) |
ConvertToT |
Converts an object to the specified target type.
If the conversion fails, an exception is thrown.
(Defined by ObjectExtensions) |
ConvertToT |
Converts an object to the specified target type.
If the conversion fails, returns the specified default value.
(Defined by ObjectExtensions) |
IsDisposable |
Determines whether the specified object is a disposable type
(i.e., it implements IDisposable interface).
(Defined by ObjectExtensions) |
Speak |
Speaks the string representation of the source object by using the
operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions) |
Speak |
Speaks the string representation of the source object by using the
operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions) |
ThrowIfNullTException |
Throws the specified exception if the source object is null.
(Defined by ObjectExtensions) |