tags:

views:

322

answers:

3

I would like to extract a pre-set zip file WITHOUT an external library to a given folder, and I would like to inform the user about the current percent of extraction (with a simple progressBar and a percent label) and the currently extracted file. Is this possible somehow?

It is important to do not use any other library.

(For updating all the labels and progressBar, I use a separate backgroundWorker)

A: 

You can use System.IO.Compression.GZipStream to extract the file. This post discusses how to compute and display to progress: http://stackoverflow.com/questions/412785/computing-progress-bar-using-gzipstream

EDIT: The comment below is correct. I thought for sure that I'd read that the GZipStream class worked with ZIP files but it's clear I was mistaken.

Rob Windsor
No, No, No. You cannot use GZipStream to extract a file from a ZIP archive. Not simply anyway. GZipStream does not handle ZIP files. This is clearly stated in the msdn documentation: http://msdn.microsoft.com/en-us/library/system.io.compression.gzipstream.aspx *this class does not inherently provide functionality for adding files to or extracting files from .zip archives.*
Cheeso
A: 

See this topic from Ultimate Zip: Unzipping files and folders. You may need to handle the Zip's Progress event to show progress information.

Mark Attwood