compress file

Posted on 2010-08-27
Last Modified: 2013-12-27

How can I compress any file using c# for windows mobile devices/windows ce? Like text file on device.

Thank you
Question by:mkk39
LVL 33

Assisted Solution

pgnatyuk earned 150 total points
ID: 33540732
SevenZipSharp is an open source project on CodePlex. Take a look:


Expert Comment

ID: 33540802

there are some open source zip libraries but their compression rate is to low. I can advise you to use pocketrar. here is the place to download it. it is freeware:

the rar file will reside somewhere under \\program files\pocket rar\rar.exe
here is an example on how to extract an archive. more information you can find on winrar help file for command line parameters:

string PKatalog = "Storage Card\\AronDB\\MyFile.txt";
string PSource = "\"\\Storage Card\\MyArchive.RAR\"";
string PDestination = "\"\\Storage Card\\\"";
string PRarPlace = "\\Program Files\\Pocket RAR\\rar.exe";
string PCommand = "e -idp -o+";

System.Diagnostics.ProcessStartInfo pi = new System.Diagnostics.ProcessStartInfo(
                PCommand + " " + PSource + " " + PDestination
            System.Diagnostics.Process p = new System.Diagnostics.Process();
            p.StartInfo = pi;


Author Comment

ID: 33541293
With SevenZipSharp  I am getting this error when try to run sample:

Could not load type 'SevenZip.SevenZipExtractor' from assembly 'SevenZipSharp, Version=0.64.3890.29348, Culture=neutral, PublicKeyToken=20DE82C62B055C88'.

Can u please help me to fix it?
LVL 33

Expert Comment

ID: 33541418
There is "Discussions" page in that project with all answers. For example:
Usage example with compression switches

Or simply delete it if it does not want to work for you - it's an open source project, choose another one.


Accepted Solution

sindhuxyz earned 350 total points
ID: 33548633
zlibce is easy to use.

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Problem with SqlConnection 4 159
Error in page 3 44
Interview questions for support of a legacy ASP.NET site 4 37
Connection String 16 42
Let me explain this picture a little bit.  First, in case you haven't already guessed, you are looking at my 2 phones, an Android Samsung Galaxy S5 on the left and an iPhone 5 on the right.  They are on their respective cradles on my desk.  But, you…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

919 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

17 Experts available now in Live!

Get 1:1 Help Now