Deployment Tools Foundation
Pack Method (sourceDirectory, includeSubdirectories, compLevel, progressHandler)
Deployment Tools Foundation Namespaces ► Microsoft.Deployment.Compression ► ArchiveInfo ► Pack(String, Boolean, CompressionLevel, EventHandler<(Of <(ArchiveProgressEventArgs>)>))
Compresses all files in a directory into the archive, optionally
including subdirectories.
Declaration Syntax
C# | Visual Basic | Visual C++ |
public void Pack( string sourceDirectory, bool includeSubdirectories, CompressionLevel compLevel, EventHandler<ArchiveProgressEventArgs> progressHandler )
Public Sub Pack ( _ sourceDirectory As String, _ includeSubdirectories As Boolean, _ compLevel As CompressionLevel, _ progressHandler As EventHandler(Of ArchiveProgressEventArgs) _ )
public: void Pack( String^ sourceDirectory, bool includeSubdirectories, CompressionLevel compLevel, EventHandler<ArchiveProgressEventArgs^>^ progressHandler )
Parameters
- sourceDirectory (String)
- This parameter may be null, but if specified it is the root directory for any relative paths in sourceFileNames.
- includeSubdirectories (Boolean)
- If true, recursively include files in subdirectories.
- compLevel (CompressionLevel)
- The compression level used when creating the archive.
- progressHandler (EventHandler<(Of <(ArchiveProgressEventArgs>)>))
- Handler for receiving progress information; this may be null if progress is not desired.
Remarks
The files are stored in the archive using their relative file paths in
the directory tree, if supported by the archive file format.