Decompressing a Zip file

Alyanto
Alyanto used Ask the Experts™
on
I am trying to find a means to unzip files in code.  I can find any number of code samples that work for .Net 4.5 but none for 3.5.  I am looking for an example
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Senior .Net Consultant
Top Expert 2016
Commented:
Since the release of the .Net Framework 3.0, we are now able to handle .zip files.  Microsoft provides the System.IO.Packaging class but it is so deeply hidden that most of us missed it. Check http://emoreau.com/Entries/Articles/2008/08/Introducing-SystemIOPackaging.aspx

Author

Commented:
CreateFilenameFromUri on line 4 in your code sample is claiming not to be declared.  I do have IO.Packaging imported so that is not the source of the problem.  Any suggestions are welcome.  

I am using framework 3.5 and due to the business reluctance to upgrade that is unfortunately my limit at the moment.
Éric MoreauSenior .Net Consultant
Top Expert 2016

Commented:
as stated in "Setting the reference", add a reference to the “WindowBase”
OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

Author

Commented:
WindowsBase has already been added which is why I was so surprised
Éric MoreauSenior .Net Consultant
Top Expert 2016

Commented:
Wait a minute. This method is a private one available in the downloadable demo.

Author

Commented:
Massive cheesy grin here!  Many thanks Eric

/Aly

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial