Zip your files using C#.Net…

Assalamualaykum Wr Br…
Today we walk through the code for compressing files in C#.Net 4.5 Framework using Zip.
There are many formats that are available in C#.Net like Deflate, GZip, Zip and many more…We focus mainly on Zip format now in later posts we try to follow other formats inshallah..
Before we start our coding, First add the reference of WindowsBase.dll” in your solution. In case if you couldn’t find it in .Net tab of references window then go to Browse tab and try to find it in the directory as shown:
“C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\”
One more thing we need to do is Import a System.IO.Packaging in your using block.
The following image shows the code:
coompress
The output of the above program is shown as:
compress_output
hope it is helpful to anyone…
Jazakallah khair

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s