2011-06-28 14 views
-4

C#で.zip(.gzipではなく)を圧縮するにはどうすればよいですか?Cで#.zipに圧縮する方法

私はちょうど簡単な答え、より好ましくはリンクが必要ですか?

おかげ

+6

-1これまでの研究はなく、実際の質問はありません。 GoogleとCodeplexを試してみるか、SOを探してみてください。 –

答えて

3

DotNetZipは良いオプションです。 (http://dotnetzip.codeplex.com/) これはかなり簡単で迅速です。

Here is an example from the site: 

Zip: 
using (ZipFile zip = new ZipFile()) 
{ 
    // add this map file into the "images" directory in the zip archive 
    zip.AddFile("c:\\images\\personal\\7440-N49th.png", "images"); 
    // add the report into a different directory in the archive 
    zip.AddFile("c:\\Reports\\2008-Regional-Sales-Report.pdf", "files"); 
    zip.AddFile("ReadMe.txt"); 
    zip.Save("MyZipFile.zip"); 
} 

Extract: 
using (ZipFile zip = ZipFile.Read(ExistingZipFile)) 
{ 
    zip.ExtractAll(TargetDirectory);  
} 
関連する問題