Solved

C# Programtically working with compressed .zip files.  Opening them, working on them and recompressing them.

Posted on 2012-03-30
3
460 Views
Last Modified: 2012-03-30
Hi Gents and Ladies,

I was hoping someone could show me by an example, how to uncompress a file prgrammatically so I can read in the text file, edit it and then (show me also) how to compress it back to a zipped archive file etc.

Let me please thank you in advance for your help.

Best - Dyno
0
Comment
Question by:Dynotoe
3 Comments
 
LVL 23

Accepted Solution

by:
wdosanjos earned 500 total points
ID: 37788928
You can use the open source ICSharpZip library.

http://www.icsharpcode.net/OpenSource/SharpZipLib/Download.aspx

Uncompress to a folder:
FastZip objFastZip = new FastZip();

objFastZip.ExtractZip("yourzipfile.zip", @"C:\uncompressfolder\", null);

Open in new window


Compress folder to zip:
FastZip objFastZip = new FastZip();

objFastZip.CreateZip("yournewzipfile.zip", @"C:\uncompressfolder\", true, null);

Open in new window


There are other options, but this is basic usage.

I hope this helps.
0
 
LVL 27

Expert Comment

by:Chinmay Patel
ID: 37788947
Hi Dyno,

How about : http://www.icsharpcode.net/opensource/sharpziplib/

For example you can look here :
http://social.msdn.microsoft.com/Forums/en/csharpgeneral/thread/e2194ba9-4e87-4c10-82a9-882b31010222

Let me know if you need more help with this.

Regards,
Chinmay.
0
 

Author Closing Comment

by:Dynotoe
ID: 37789002
First to answer and you used a quick example.  Thx - D
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Systems talking to each other 5 110
Where to begin studying? 5 66
Default parameter problem in C# 3 27
cookies analysis tools 2 29
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now