ZipUtils.ZipFiles Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| ZipFiles(List<String>, String, Boolean) |
Zips the requested files into the output ZipFile. |
| ZipFiles(String, String, Boolean) |
Zips the directory specified to the output Zip File. |
ZipFiles(List<String>, String, Boolean)
Zips the requested files into the output ZipFile.
public static bool ZipFiles(System.Collections.Generic.List<string> fileNames, string outputZipFile, bool flattenStructure = false);
static member ZipFiles : System.Collections.Generic.List<string> * string * bool -> bool
Public Shared Function ZipFiles (fileNames As List(Of String), outputZipFile As String, Optional flattenStructure As Boolean = false) As Boolean
Parameters
- outputZipFile
- String
Specifies the output zip file.
- flattenStructure
- Boolean
Specifies whether to flatten the directory structure or not. If true, the files won't retain their actual directory structure and will be added under the source directory.
Returns
true if the files are zipped successfully; otherwise, false.
Applies to
ZipFiles(String, String, Boolean)
Zips the directory specified to the output Zip File.
public static bool ZipFiles(string directoryToAdd, string outputZipFile, bool flattenStructure = false);
static member ZipFiles : string * string * bool -> bool
Public Shared Function ZipFiles (directoryToAdd As String, outputZipFile As String, Optional flattenStructure As Boolean = false) As Boolean
Parameters
- directoryToAdd
- String
Specifies the directory name.
- outputZipFile
- String
Specifies the output zip file name.
- flattenStructure
- Boolean
Specifies whether to flatten the directory structure or not. If true, the files won't retain their actual directory structure and will be added under the source directory.
Returns
true if the zip operation is successful; otherwise, false.