AsposeVisualStudioPluginCells.Core.ZipUtilities.ExtractZipFile C# (CSharp) Method

ExtractZipFile() public method

Unzip files
public ExtractZipFile ( string zipFilePath, string pathToExtract ) : System.Boolean
zipFilePath string
pathToExtract string
return System.Boolean
        public Boolean ExtractZipFile(string zipFilePath, string pathToExtract)
        {
            try
            {
                var options = new ReadOptions { StatusMessageWriter = System.Console.Out };
                using (ZipFile zip = ZipFile.Read(zipFilePath, options))
                {
                    // This call to ExtractAll() assumes:
                    //   - none of the entries are password-protected.
                    //   - want to extract all entries to current working directory
                    //   - none of the files in the zip already exist in the directory;
                    //     if they do, the method will throw.
                    zip.ExtractAll(pathToExtract);
                }
            }
            catch (Exception)
            {
                return false;
            }
            return true;
        }
  

Usage Example

        public static void unZipFile(string zipFile, string outputFolder)
        {
            try
            {
                if (Directory.Exists(outputFolder))
                {
                    Directory.Delete(outputFolder, true);
                }
            }
            catch { }
            ZipUtilities zipUtilities = new ZipUtilities();

            zipUtilities.ExtractZipFile(zipFile, outputFolder);
        }
All Usage Examples Of AsposeVisualStudioPluginCells.Core.ZipUtilities::ExtractZipFile
ZipUtilities