<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="http://www.codeplex.com/rss.xsl"?><rss version="2.0"><channel><title>DotNet Zip Library</title><link>http://www.codeplex.com/DotNetZip/Project/ProjectRss.aspx</link><description>DotNetZip is a small, easy-to-use class library for manipulating .zip files.  It can enable .NET applications written in VB.NET, C&amp;#35;, any .NET language, to easily create, read, and update zip files....</description><item><title>New Post: AddDirecory : Logic difference between DotNet Zip an others archivers</title><link>http://www.codeplex.com/DotNetZip/Thread/View.aspx?ThreadId=37443</link><description>&lt;div style="line-height: normal;"&gt;Can you be more specific about what you see?&lt;br&gt;
with an example of how the files are structured and how you would like the files to be structured.
&lt;/div&gt;</description><author>Cheeso</author><pubDate>Fri, 10 Oct 2008 16:26:49 GMT</pubDate><guid isPermaLink="false">New Post: AddDirecory : Logic difference between DotNet Zip an others archivers 20081010042649P</guid></item><item><title>New Post: fulltrust required</title><link>http://www.codeplex.com/DotNetZip/Thread/View.aspx?ThreadId=32746</link><description>&lt;div style="line-height: normal;"&gt;
&lt;div&gt;&lt;span class=312025015-10102008&gt;Glad to help 
:)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span class=312025015-10102008&gt;    
cheers.&lt;/span&gt;&lt;/div&gt;
&lt;blockquote style="margin-right:0px" dir=ltr&gt;
  &lt;div dir=ltr class=OutlookMessageHeader align=left&gt;-----Messaggio originale-----&lt;br&gt;&lt;b&gt;Da:&lt;/b&gt; Cheeso 
  [mailto:notifications@codeplex.com]&lt;br&gt;&lt;b&gt;Inviato:&lt;/b&gt; venerdì 10 ottobre 2008 
  5.28&lt;br&gt;&lt;b&gt;A:&lt;/b&gt; max@max3d.it&lt;br&gt;&lt;b&gt;Oggetto:&lt;/b&gt; Re: fulltrust required 
  [DotNetZip:32746]&lt;br&gt;&lt;br&gt;&lt;/div&gt;
  &lt;p&gt;From: Cheeso&lt;/p&gt;
  &lt;div id=ThreadNotificationPostBody&gt;Glad it is working for you.  Thank you 
  for the donation!&lt;br&gt;every little bit helps. &lt;br&gt;if every user of the library 
  donated like you did, the Boys &amp; Girls club would get a really really big 
  check! &lt;/div&gt;
  &lt;/blockquote&gt;&lt;/div&gt;</description><author>Max3D</author><pubDate>Fri, 10 Oct 2008 15:52:36 GMT</pubDate><guid isPermaLink="false">New Post: fulltrust required 20081010035236P</guid></item><item><title>Created Issue: private ZipCrypto SetupCipher(string password) approves an incorrect password</title><link>http://www.codeplex.com/DotNetZip/WorkItem/View.aspx?WorkItemId=6416</link><description>I posted another issue yesterday about ZipCrypto not passing an correct password and that were properly solved.&lt;br /&gt;&lt;br /&gt;Im testning this ZipLibary when Im playing with an Zip brute-force password breaker and now I experiencing another issue.&lt;br /&gt;&lt;br /&gt;When I have created a Zip file by winrar with the password &amp;#34;t2&amp;#34; im getting the password &amp;#34;c9&amp;#34; to be valid and its this row that allows it.&lt;br /&gt;&lt;br /&gt;Im not sure if have missed something but Im copied the method SetupCipher and modified it a little bit to work better with my solution cause if Im making a password brute force breaker I don&amp;#39;t want any exception to be thrown but so here is the code I have been testing with, but it shouldn&amp;#39;t be any differences.&lt;br /&gt;&lt;br /&gt;        public bool ValidatePassword&amp;#40;string password&amp;#41;&lt;br /&gt;        &amp;#123;&lt;br /&gt;            ZipCrypto cipher &amp;#61; null&amp;#59;&lt;br /&gt;            &amp;#47;&amp;#47; decrypt the file header data here if necessary. &lt;br /&gt;            if &amp;#40;Encryption &amp;#61;&amp;#61; EncryptionAlgorithm.PkzipWeak&amp;#41;&lt;br /&gt;            &amp;#123;&lt;br /&gt;                if &amp;#40;password &amp;#61;&amp;#61; null&amp;#41;&lt;br /&gt;                    throw new BadPasswordException&amp;#40;&amp;#34;This entry requires a password.&amp;#34;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;                cipher &amp;#61; new ZipCrypto&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;                cipher.InitCipher&amp;#40;password&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;                &amp;#47;&amp;#47; Decrypt the header.  This has a side effect of &amp;#34;further initializing the&lt;br /&gt;                &amp;#47;&amp;#47; encryption keys&amp;#34; in the traditional zip encryption. &lt;br /&gt;                byte&amp;#91;&amp;#93; DecryptedHeader &amp;#61; cipher.DecryptMessage&amp;#40;_WeakEncryptionHeader, _WeakEncryptionHeader.Length&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;                &amp;#47;&amp;#47; CRC check&lt;br /&gt;                &amp;#47;&amp;#47; According to the pkzip spec, the final byte in the decrypted header &lt;br /&gt;                &amp;#47;&amp;#47; is the highest-order byte in the CRC. We check it here. &lt;br /&gt;                if &amp;#40;DecryptedHeader&amp;#91;11&amp;#93; &amp;#33;&amp;#61; &amp;#40;byte&amp;#41;&amp;#40;&amp;#40;_Crc32 &amp;#62;&amp;#62; 24&amp;#41; &amp;#38; 0xff&amp;#41;&amp;#41;&lt;br /&gt;                &amp;#123;&lt;br /&gt;                    &amp;#47;&amp;#47; In the case that bit 3 of the general purpose bit flag is set to indicate&lt;br /&gt;                    &amp;#47;&amp;#47; the presence of an &amp;#39;Extended File Header&amp;#39;, the last byte of the decrypted&lt;br /&gt;                    &amp;#47;&amp;#47; header is sometimes compared with the high-order byte of the lastmodified &lt;br /&gt;                    &amp;#47;&amp;#47; time, and not the CRC, to verify the password. &lt;br /&gt;                    &amp;#47;&amp;#47;&lt;br /&gt;                    &amp;#47;&amp;#47; This is not documented in the PKWare Appnote.txt.  &lt;br /&gt;                    &amp;#47;&amp;#47; This was discovered this by analysis of the Crypt.c source file in the InfoZip library&lt;br /&gt;                    &amp;#47;&amp;#47; http&amp;#58;&amp;#47;&amp;#47;www.info-zip.org&amp;#47;pub&amp;#47;infozip&amp;#47;&lt;br /&gt;&lt;br /&gt;                    if &amp;#40;&amp;#40;_BitField &amp;#38; 0x0008&amp;#41; &amp;#33;&amp;#61; 0x0008&amp;#41;&lt;br /&gt;                    &amp;#123;&lt;br /&gt;                        return false&amp;#59;&lt;br /&gt;                    &amp;#125;&lt;br /&gt;                    else if &amp;#40;DecryptedHeader&amp;#91;11&amp;#93; &amp;#33;&amp;#61; &amp;#40;byte&amp;#41;&amp;#40;&amp;#40;_TimeBlob &amp;#62;&amp;#62; 8&amp;#41; &amp;#38; 0xff&amp;#41;&amp;#41;&lt;br /&gt;                    &amp;#123;&lt;br /&gt;                        return false&amp;#59;&lt;br /&gt;                    &amp;#125;&lt;br /&gt;                &amp;#125;  &lt;br /&gt;            &amp;#125;&lt;br /&gt;            return true&amp;#59;&lt;br /&gt;        &amp;#125;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The error should be here&amp;#58;&lt;br /&gt;                    if &amp;#40;&amp;#40;_BitField &amp;#38; 0x0008&amp;#41; &amp;#33;&amp;#61; 0x0008&amp;#41;&lt;br /&gt;                    &amp;#123;&lt;br /&gt;                        return false&amp;#59;&lt;br /&gt;                    &amp;#125;&lt;br /&gt;                    else if &amp;#40;DecryptedHeader&amp;#91;11&amp;#93; &amp;#33;&amp;#61; &amp;#40;byte&amp;#41;&amp;#40;&amp;#40;_TimeBlob &amp;#62;&amp;#62; 8&amp;#41; &amp;#38; 0xff&amp;#41;&lt;br /&gt;                    &amp;#123;&lt;br /&gt;                        return false&amp;#59;&lt;br /&gt;                    &amp;#125;&lt;br /&gt;&lt;br /&gt;Ive even experienced once when it jumped out here&lt;br /&gt;if &amp;#40;DecryptedHeader&amp;#91;11&amp;#93; &amp;#33;&amp;#61; &amp;#40;byte&amp;#41;&amp;#40;&amp;#40;_Crc32 &amp;#62;&amp;#62; 24&amp;#41; &amp;#38; 0xff&amp;#41;&amp;#41; with the wrong password data that were used.&lt;br /&gt;</description><author>NiclasPehrsson</author><pubDate>Fri, 10 Oct 2008 09:56:07 GMT</pubDate><guid isPermaLink="false">Created Issue: private ZipCrypto SetupCipher(string password) approves an incorrect password 20081010095607A</guid></item><item><title>Created Issue: Comments in Self-Extractor archives not correctly handled</title><link>http://www.codeplex.com/DotNetZip/WorkItem/View.aspx?WorkItemId=6415</link><description>Hi,&lt;br /&gt;&lt;br /&gt;I use the last version of the 1.6 preview &amp;#40;09&amp;#47;10&amp;#41;, and I saw when using the WinForms example &amp;#40;good upgrade &amp;#33;&amp;#41; that when we choose to generate a self extractor archive the comments are not correctly encoded.&lt;br /&gt;&lt;br /&gt;I&amp;#39;ve attached an image to show the problem &amp;#40;&amp;#233; char replaced by &amp;#920; char&amp;#41;.&lt;br /&gt;&lt;br /&gt;Regards&lt;br /&gt;Dominique&lt;br /&gt;</description><author>DomZ</author><pubDate>Fri, 10 Oct 2008 09:09:09 GMT</pubDate><guid isPermaLink="false">Created Issue: Comments in Self-Extractor archives not correctly handled 20081010090909A</guid></item><item><title>New Post: AddDirecory : Logic difference DotNet Zip an others archivers</title><link>http://www.codeplex.com/DotNetZip/Thread/View.aspx?ThreadId=37443</link><description>&lt;div style="line-height: normal;"&gt;Hi,&lt;br&gt;
&lt;br&gt;
I noticed something quite strange (or at least different) with DotNet Zip.&lt;br&gt;
&lt;br&gt;
When you&amp;nbsp;compress a directory&amp;nbsp;with WinRAR and 7zip (right click on a folder under Windows) :&lt;br&gt;
=&amp;gt; The ouput archives contains in the root the folder.&lt;br&gt;
&lt;br&gt;
When you compress a directory with DotNet Zip (using the WinForms sample) :&lt;br&gt;
=&amp;gt; The output archive contains the content of the folder in the root&lt;br&gt;
&lt;br&gt;
Cheeso, may be we need an option in the AddDirectory method to either compress the folder content or compress with the folder in root.&lt;br&gt;
&lt;br&gt;
Thanks
&lt;/div&gt;</description><author>DomZ</author><pubDate>Fri, 10 Oct 2008 09:02:41 GMT</pubDate><guid isPermaLink="false">New Post: AddDirecory : Logic difference DotNet Zip an others archivers 20081010090241A</guid></item><item><title>Commented Issue: SetupCipher throws BadPasswordException even when the password is correct</title><link>http://www.codeplex.com/DotNetZip/WorkItem/View.aspx?WorkItemId=6408</link><description>The method private ZipCrypto SetupCipher&amp;#40;string password&amp;#41; throws  BadPasswordException when the password to the archive are correct, I have only tested once with an ZipArchive created by Winrar and where the password were &amp;#34;test&amp;#34;.&lt;br /&gt;Here is the code that throws the exception.&lt;br /&gt;                &amp;#47;&amp;#47; CRC check&lt;br /&gt;                &amp;#47;&amp;#47; According to the pkzip spec, the final byte in the decrypted header &lt;br /&gt;                &amp;#47;&amp;#47; is the highest-order byte in the CRC. We check it here. &lt;br /&gt;                if &amp;#40;DecryptedHeader&amp;#91;11&amp;#93; &amp;#33;&amp;#61; &amp;#40;byte&amp;#41;&amp;#40;&amp;#40;_Crc32 &amp;#62;&amp;#62; 24&amp;#41; &amp;#38; 0xff&amp;#41;&amp;#41;&lt;br /&gt;                &amp;#123;&lt;br /&gt;                    throw new BadPasswordException&amp;#40;&amp;#34;The password did not match.&amp;#34;&amp;#41;&amp;#59;&lt;br /&gt;                &amp;#125;&lt;br /&gt;&lt;br /&gt;If I removes this code and have the correct password everything works nice so I suppose the error lies in this block. Thanks for an extraordinary libary&lt;br /&gt;Im attatching the file that I have problems with.&lt;br /&gt;My version of DotNet Zip Libary is the 1.6 &amp;#40;preview&amp;#41;, i will test with the earlier version now.&lt;br /&gt;Comments: ** Comment from web user: NiclasPehrsson ** &lt;p&gt;Fast and good work.&lt;/p&gt;</description><author>NiclasPehrsson</author><pubDate>Fri, 10 Oct 2008 08:56:28 GMT</pubDate><guid isPermaLink="false">Commented Issue: SetupCipher throws BadPasswordException even when the password is correct 20081010085628A</guid></item><item><title>Reviewed: 1.6 DotNetZip Library (preview) (Oct 10, 2008)</title><link>http://www.codeplex.com/DotNetZip/Release/ProjectReleases.aspx?ReleaseId=14569</link><description>Rated 4 Stars (out of 5) - Smart but powerfull. 
Thank you for your good job. 
Respecting to add a Unicode version which can handle other encoding characters with function parameters. ;-) </description><author>maqintoshi</author><pubDate>Fri, 10 Oct 2008 07:45:53 GMT</pubDate><guid isPermaLink="false">Reviewed: 1.6 DotNetZip Library (preview) (Oct 10, 2008) 20081010074553A</guid></item><item><title>Source code checked in, #25208</title><link>http://www.codeplex.com/DotNetZip/SourceControl/ListDownloadableCommits.aspx</link><description>More updates for the helpfile.</description><author>Cheeso</author><pubDate>Fri, 10 Oct 2008 07:14:04 GMT</pubDate><guid isPermaLink="false">Source code checked in, #25208 20081010071404A</guid></item><item><title>Updated Release: 1.6 DotNetZip Library (preview) (Oct 09, 2008)</title><link>http://www.codeplex.com/DotNetZip/Release/ProjectReleases.aspx?ReleaseId=14569</link><description>&lt;div&gt;
&lt;i&gt;This is a preview release.  It will be updated regularly until such time as the release is large and stable enough to warrant a freeze.&lt;/i&gt;&lt;br&gt; &lt;br&gt;Last update: October 9, 2008.&lt;br&gt; &lt;br&gt;Major new features:&lt;br&gt;&lt;ul&gt;
&lt;li&gt;filenames/comments in Unicode or any codepage - workitem 3152 &lt;/li&gt;&lt;li&gt;add the AllowPartiallyTrustedCallersAttribute, to allow this DLL in partial trust situations, for example where your ASP.NET host specifies &amp;quot;medium&amp;quot; trust on your website. - workitem 4698&lt;/li&gt;&lt;li&gt;new method ZipEntry.OpenReader() allows applications to read an entry directly from the zip stream. - workitem 5442&lt;/li&gt;&lt;li&gt;new static method ZipFile.IsZipFile() to test a file to see if it appears to be a valid zip file. - workitem 5506&lt;/li&gt;&lt;li&gt;use the generic EventHandler model. &lt;/li&gt;&lt;li&gt;Updated the self-extractor UI to be more pleasant and adaptive.  Long comments are shown correctly. &lt;/li&gt;&lt;li&gt;events &amp;amp; cancel for ExtractAll - workitem 5792&lt;/li&gt;&lt;li&gt;FxCop compliance in the source code. Well, a little, anyway. &lt;/li&gt;&lt;li&gt;changed the string indexer on ZipFile to use case-insensitive comparisons - workitem 5740&lt;/li&gt;&lt;li&gt;ExtractAll and Extract methods on ZipFile now implicitly use the password set on the ZipFile instance.&lt;/li&gt;&lt;li&gt;AddDirectoryByName method on ZipFile - workitem 5671&lt;/li&gt;&lt;li&gt;delegate to check if reading a stream twice is ok - workitem 5829&lt;/li&gt;
&lt;/ul&gt; &lt;br&gt;fixes:&lt;br&gt;&lt;ul&gt;
&lt;li&gt;intelligently handle large files via streaming - workitem 5028&lt;/li&gt;&lt;li&gt;added exception handling in Save(); no more temp files  when an exception occurs. - workitem 5043&lt;/li&gt;&lt;li&gt;fixed a NPE problem with password-protected files of zero length. - workitem 5722&lt;/li&gt;&lt;li&gt;correctly handle files with a leading dot-slash. &lt;/li&gt;&lt;li&gt;Fixed SaveProgress event so that it actually responds to a Cancel request. Also added a working winforms example to demonstrate this.  - workitem 5558&lt;/li&gt;&lt;li&gt;Handle the case where Extract() is called immediately after Save().  - workitem 5593&lt;/li&gt;&lt;li&gt;don't produce corrupt zipfiles after Remove() - workitem 5616&lt;/li&gt;&lt;li&gt;better exceptions - workitem 5998 and 6048&lt;/li&gt;&lt;li&gt;handle .docx file (workitem 6182)&lt;/li&gt;
&lt;/ul&gt; &lt;br&gt;Some of the changes I made for FxCOP compliance, are BREAKING changes.  This means that while most old applications will just work when you just recompile them against the new library, &lt;i&gt;some&lt;/i&gt; will not.&lt;br&gt;&lt;ul&gt;
&lt;li&gt;I changed the param names of numerous methods.  If you are using Reflection to invoke the library, the different param names will cause your app to break.  I suspect this will be a small set of people, possibly zero.  The workaround is pretty simple - just use the correct param names. &lt;/li&gt;&lt;li&gt;for CLS compliance, the Crc32 class now returns Int32 for the calculated CRC, not Uint32.  &lt;/li&gt;&lt;li&gt;Some of the Exceptions have changed. &lt;/li&gt;
&lt;/ul&gt; &lt;br&gt;This release has these downloads:&lt;br&gt;&lt;ol&gt;
&lt;li&gt;&lt;b&gt;DotNetzip-src-v1.6.x.x.zip&lt;/b&gt; - the source code for the Zip Library, the setup (msi) project, and a bunch of examples. Download this if you want to play with the library, extend the example utilities, or perhaps modify and embed it into your own application. &lt;/li&gt;&lt;li&gt;&lt;b&gt;DotNetZipLib-DevKit-v1.6.zip&lt;/b&gt; - a binary release, that includes of the signed Zip Library (DLL), the XML Documentation file for intellisense, the compiled help file (CHM), and the License.   Download this if you want to write .NET applications that use the Zip library.  &lt;/li&gt;&lt;li&gt;&lt;b&gt;DotNetZipLib-RuntimeOnly-v1.6.zip&lt;/b&gt; - a binary release, that includes of the signed Zip Library (DLL), and the License.   Download this if you want to distribute .NET applications that use the Zip library, or if you want to run a .NET application that depends on this library.  &lt;/li&gt;&lt;li&gt;&lt;b&gt;DotNetZipUtils-v1.6.zip&lt;/b&gt; - a set of command-line exe utilities that rely on the library.   zipit (Creates zips), unzip (obvious), and CreateSelfExtractor.exe (creates self extracting zips).  Download this if you want command-line tools to manipulate zip files.   &lt;/li&gt;&lt;li&gt;&lt;b&gt;DotNetZipUtils-v1.6.msi&lt;/b&gt; - an installer for Windows for the command-line Zip utilities that utilize the library. This is the same stuff as the DotNetZipUtils-v1.6.zip, but in MSI form.&lt;/li&gt;&lt;li&gt;&lt;b&gt;DotNetZipLib-v1.6.chm&lt;/b&gt; - the compiled help file for the Zip library. &lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description><author>Cheeso</author><pubDate>Fri, 10 Oct 2008 07:13:18 GMT</pubDate><guid isPermaLink="false">Updated Release: 1.6 DotNetZip Library (preview) (Oct 09, 2008) 20081010071318A</guid></item><item><title>Source code checked in, #25206</title><link>http://www.codeplex.com/DotNetZip/SourceControl/ListDownloadableCommits.aspx</link><description>update for the DotNetZip help file.  </description><author>Cheeso</author><pubDate>Fri, 10 Oct 2008 06:32:39 GMT</pubDate><guid isPermaLink="false">Source code checked in, #25206 20081010063239A</guid></item><item><title>Updated Wiki: Examples</title><link>http://www.codeplex.com/DotNetZip/Wiki/View.aspx?title=Examples&amp;version=23</link><description>&lt;div class="wikidoc"&gt;
There are examples shipped in the source code.  If you want to just have a quick look, though, I have a bunch on this page.   Also check out the &lt;a href="http://www.codeplex.com/DotNetZip/Wiki/View.aspx?title=ASPNET%20Example%201&amp;amp;referringTitle=Examples"&gt;Full ASP.NET Example&lt;/a&gt;, which is on a separate wiki page. &lt;br /&gt; &lt;br /&gt;Add items to a zip file, using the same password for all items&lt;br /&gt;&lt;pre&gt;
  using (ZipFile zip = new ZipFile(&amp;quot;Backup.zip&amp;quot;))
  {
    zip.Password= &amp;quot;123456!&amp;quot;;
    zip.AddFile(&amp;quot;ReadMe.txt&amp;quot;);
    zip.AddFile(&amp;quot;7440-N49th.png&amp;quot;);
    zip.AddFile(&amp;quot;2005_Annual_Report.pdf&amp;quot;);        
    zip.Save();
  }
&lt;/pre&gt; &lt;br /&gt; &lt;br /&gt;Add items to a zip file, using different passwords for different items.&lt;br /&gt;&lt;pre&gt;
  using (ZipFile zip = new ZipFile(&amp;quot;Backup.zip&amp;quot;))
  {
    zip.AddFile(&amp;quot;ReadMe.txt&amp;quot;); // no password for this one
    zip.Password= &amp;quot;123456!&amp;quot;;
    zip.AddFile(&amp;quot;7440-N49th.png&amp;quot;);
    zip.Password= &amp;quot;!Secret1&amp;quot;;
    zip.AddFile(&amp;quot;2005_Annual_Report.pdf&amp;quot;);
    
    zip.Save();
  }
&lt;/pre&gt; &lt;br /&gt; &lt;br /&gt;Create a zip, but Tell the library to not use compression when adding in the file.  This makes sense with previously-compressed files like .mp3 format:&lt;br /&gt;&lt;pre&gt;
  using (ZipFile zip = new ZipFile(ZipFileToCreate))
  {
    zip.ForceNoCompression = true;
    zip.AddFile(@&amp;quot;MyMusic\Messiah-01.mp3&amp;quot;);
    zip.Save();
  }
&lt;/pre&gt; &lt;br /&gt; &lt;br /&gt;Zip up an entire directory, recursively, and specify a comment on the zip archive when creating it: &lt;br /&gt;&lt;pre&gt;
  using (ZipFile zip = new ZipFile(ZipFileToCreate))
  {
    zip.AddDirectory(@&amp;quot;MyDocuments\ProjectX&amp;quot;);
    zip.Comment = &amp;quot;This zip was created at &amp;quot; + System.DateTime.Now.ToString(&amp;quot;G&amp;quot;) ; 
    zip.Save();
  }
&lt;/pre&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt;Zip up a set of files, each protected by the same password.  Also, specify the last modified time for all of the files as they are stored in the zip archive:&lt;br /&gt;&lt;pre&gt;
  using (ZipFile zip = new ZipFile(ZipFileToCreate))
  {
    zip1.Password = Password;
    System.DateTime Timestamp = new System.DateTime(2008,05,30,12,0,0);
    String[] filenames = System.IO.Directory.GetFiles(&amp;quot;ProjectDocuments&amp;quot;);
    foreach (String f in filenames)
    {
      ZipEntry e = zip.AddFile(f, &amp;quot;docs&amp;quot;);
      e.LastModified = Timestamp;
    }
    zip.Comment = &amp;quot;This zip was created at &amp;quot; + System.DateTime.Now.ToString(&amp;quot;G&amp;quot;) ; 
    zip.Save();
  }
&lt;/pre&gt; &lt;br /&gt; &lt;br /&gt;Zip up a set of files and directories, and &lt;i&gt;re-map them into a different directory hierarchy&lt;/i&gt; in the zip file: &lt;br /&gt;&lt;pre&gt;
  using (ZipFile zip = new ZipFile(ZipFileToCreate))
  {
    // files in the filesystem like MyDocuments\ProjectX\File1.txt , will be stored in the zip archive as  backup\File1.txt
    zip.AddDirectory(@&amp;quot;MyDocuments\ProjectX&amp;quot;, &amp;quot;backup&amp;quot;);
    // files in the filesystem like MyMusic\Santana\OyeComoVa.mp3, will be stored in the zip archive as  tunes\Santana\OyeComoVa.mp3
    zip.AddDirectory(&amp;quot;MyMusic&amp;quot;, &amp;quot;tunes&amp;quot;);
    // The Readme.txt file in the filesystem will be stored in the zip archive as documents\Readme.txt
    zip.AddDirectory(&amp;quot;Readme.txt&amp;quot;, &amp;quot;documents&amp;quot;);
 
    zip.Comment = &amp;quot;This zip was created at &amp;quot; + System.DateTime.Now.ToString(&amp;quot;G&amp;quot;) ; 
    zip.Save();
  }
&lt;/pre&gt; &lt;br /&gt; &lt;br /&gt;Add content obtained from a stream into a zip archive.  Also, add a comment to the entry that was added from the stream: &lt;br /&gt;&lt;pre&gt;
  using (ZipFile zip = ZipFile.Read(ZipToCreate))
  {
    ZipEntry e= zip.AddFileStream(&amp;quot;Content-From-Stream.bin&amp;quot;, &amp;quot;basedirectory&amp;quot;, StreamToRead);
    e.Comment = &amp;quot;The content for entry in the zip file was obtained from a stream&amp;quot;;
    zip.AddFile(&amp;quot;Readme.txt&amp;quot;);
    zip.Save();
  }
&lt;/pre&gt; &lt;br /&gt; &lt;br /&gt;Remove an entry from an existing zip file (first supported in v1.5 of the library):&lt;br /&gt;&lt;pre&gt;
  using (ZipFile zip = ZipFile.Read(ExistingZipFile))
  {
    // use the indexer to remove the file from the zip archive
    zip[&amp;quot;Readme.txt&amp;quot;] = null;
    zip.Comment = &amp;quot;This archive has been modified from its original version. Some files have been removed.&amp;quot;;
    zip.Save();
  }
&lt;/pre&gt; &lt;br /&gt; &lt;br /&gt;Extract all files from a zip archive;&lt;br /&gt;&lt;pre&gt;
  using (ZipFile zip = ZipFile.Read(ExistingZipFile))
  {
    foreach (ZipEntry e in zip)
    {
      e.Extract(TargetDirectory);
    }
  }
&lt;/pre&gt; &lt;br /&gt; &lt;br /&gt;The default behavior of extraction is to NOT overwrite existing files. In this example, the app Extracts all files, and overwrites existing files in the filesystem:&lt;br /&gt;&lt;pre&gt;
  using (ZipFile zip = ZipFile.Read(ExistingZipFile))
  {
    foreach (ZipEntry e in zip)
    {
      e.Extract(TargetDirectory, true);  // overwrite == true
    }
  }
&lt;/pre&gt; &lt;br /&gt; &lt;br /&gt;Extract an entry from the zip archive into a previously-opened stream:&lt;br /&gt;&lt;pre&gt;
  using (ZipFile zip = ZipFile.Read(ExistingZipFile))
  {
    ZipEntry e = zip[&amp;quot;MyReport.doc&amp;quot;];
    e.Extract(OutputStream);
  }
&lt;/pre&gt; &lt;br /&gt; &lt;br /&gt;Extract an Entry that was encrypted with a password, into the specified base directory:&lt;br /&gt;&lt;pre&gt;
  using (ZipFile zip = ZipFile.Read(ExistingZipFile))
  {
    ZipEntry e = zip[&amp;quot;TaxInformation-2008.xls&amp;quot;];
    e.ExtractWithPassword(BaseDirectory, Password);
  }
&lt;/pre&gt; &lt;br /&gt; &lt;br /&gt;List all the entries in a zip file: &lt;br /&gt;&lt;pre&gt;
  using (ZipFile zip = ZipFile.Read(ExistingZipFile))
  {
    foreach (ZipEntry e in zip)
    {
      if (header)
      {
        System.Console.WriteLine(&amp;quot;Zipfile: {0}&amp;quot;, zip.Name);
        if ((zip.Comment != null) &amp;amp;&amp;amp; (zip.Comment != &amp;quot;&amp;quot;)) 
          System.Console.WriteLine(&amp;quot;Comment: {0}&amp;quot;, zip.Comment);
        System.Console.WriteLine(&amp;quot;\n{1,-22} {2,8}  {3,5}   {4,8}  {5,3} {0}&amp;quot;,
                                 &amp;quot;Filename&amp;quot;, &amp;quot;Modified&amp;quot;, &amp;quot;Size&amp;quot;, &amp;quot;Ratio&amp;quot;, &amp;quot;Packed&amp;quot;, &amp;quot;pw?&amp;quot;);
        System.Console.WriteLine(new System.String('-', 72));
        header = false;
      }
      System.Console.WriteLine(&amp;quot;{1,-22} {2,8} {3,5:F0}%   {4,8}  {5,3} {0}&amp;quot;,
                               e.FileName,
                               e.LastModified.ToString(&amp;quot;yyyy-MM-dd HH:mm:ss&amp;quot;),
                               e.UncompressedSize,
                               e.CompressionRatio,
                               e.CompressedSize,
                               (e.UsesEncryption) ? &amp;quot;Y&amp;quot; : &amp;quot;N&amp;quot;);
 
    }
  }
&lt;/pre&gt; &lt;br /&gt; &lt;br /&gt;Read in zip archive content from a stream, then extract the content for one entry to another stream.  In this example, the filename &amp;quot;NameOfEntryInArchive.doc&amp;quot;, refers only to the name of the entry within the zip archive.  A file by that name is not created in the filesystem.  The I/O is done strictly with the given streams. &lt;br /&gt;&lt;pre&gt;
  using (ZipFile zip = ZipFile.Read(InputStream))
  {
    zip.Extract(&amp;quot;NameOfEntryInArchive.doc&amp;quot;, OutputStream);
  }
&lt;/pre&gt; &lt;br /&gt; &lt;br /&gt;Create a zip dynamically within an ASP.NET postback method, then download that zipfile to the requesting browser through Response.OutputStream. (works in v1.5 and later)&lt;br /&gt;&lt;pre&gt;
public void btnGo_Click (Object sender, EventArgs e)
{
  Response.Clear();
  String ReadmeText= &amp;quot;This is a zip file dynamically generated at &amp;quot; + System.DateTime.Now.ToString(&amp;quot;G&amp;quot;);
  string filename = System.IO.Path.GetFileName(ListOfFiles.SelectedItem.Text) + &amp;quot;.zip&amp;quot;;
  Response.ContentType = &amp;quot;application/zip&amp;quot;;
  Response.AddHeader(&amp;quot;content-disposition&amp;quot;, &amp;quot;filename=&amp;quot; + filename);
  
  using (ZipFile zip = new ZipFile(Response.OutputStream)) {
    zip.AddFile(ListOfFiles.SelectedItem.Text, &amp;quot;files&amp;quot;);
    zip.AddFileFromString(&amp;quot;Readme.txt&amp;quot;, &amp;quot;&amp;quot;, ReadmeText);
    zip.Save();
  }
 
  Response.End();
}
 
&lt;/pre&gt; &lt;br /&gt; &lt;br /&gt;Create a zip with a single entry, obtaining the content for that entry from a string.   Specify the name of the zip file at the time of save. &lt;br /&gt;&lt;pre&gt;
  string content = &amp;quot;......whatever....&amp;quot;;  
  using (ZipFile zip = new ZipFile())
  {
    ZipEntry e = zip.AddFileFromString(&amp;quot;README.txt&amp;quot;, &amp;quot;&amp;quot;, content);
    e.Comment = &amp;quot;This entry in the zip archive was created from a string.&amp;quot;;
    zip.Save(&amp;quot;archive-2008july12.zip&amp;quot;);
  }
&lt;/pre&gt; &lt;br /&gt; &lt;br /&gt;Open an existing zip archive and modify it:  update one entry and remove another. &lt;br /&gt;&lt;pre&gt;
  using (ZipFile zip = ZipFile.Read(&amp;quot;ExistingArchive.zip&amp;quot;))
  {
    ZipEntry e = zip[&amp;quot;README.txt&amp;quot;];
    e.RemoveEntry();
    zip.UpdateItem(&amp;quot;Portfolio.doc&amp;quot;); 
    zip.Comment = &amp;quot;This zip archive was updated &amp;quot; + System.DateTime.ToString(&amp;quot;G&amp;quot;); 
    zip.Save();
  }
&lt;/pre&gt; &lt;br /&gt; &lt;br /&gt;
&lt;/div&gt;</description><author>Cheeso</author><pubDate>Fri, 10 Oct 2008 06:19:33 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Examples 20081010061933A</guid></item><item><title>Updated Release: 1.6 DotNetZip Library (preview) (Oct 09, 2008)</title><link>http://www.codeplex.com/DotNetZip/Release/ProjectReleases.aspx?ReleaseId=14569</link><description>&lt;div&gt;
&lt;i&gt;This is a preview release.  It will be updated regularly until such time as the release is large and stable enough to warrant a freeze.&lt;/i&gt;&lt;br&gt; &lt;br&gt;Last update: October 9, 2008.&lt;br&gt; &lt;br&gt;Major new features:&lt;br&gt;&lt;ul&gt;
&lt;li&gt;filenames/comments in Unicode or any codepage - workitem 3152 &lt;/li&gt;&lt;li&gt;add the AllowPartiallyTrustedCallersAttribute, to allow this DLL in partial trust situations, for example where your ASP.NET host specifies &amp;quot;medium&amp;quot; trust on your website. - workitem 4698&lt;/li&gt;&lt;li&gt;new method ZipEntry.OpenReader() allows applications to read an entry directly from the zip stream. - workitem 5442&lt;/li&gt;&lt;li&gt;new static method ZipFile.IsZipFile() to test a file to see if it appears to be a valid zip file. - workitem 5506&lt;/li&gt;&lt;li&gt;use the generic EventHandler model. &lt;/li&gt;&lt;li&gt;Updated the self-extractor UI to be more pleasant and adaptive.  Long comments are shown correctly. &lt;/li&gt;&lt;li&gt;events &amp;amp; cancel for ExtractAll - workitem 5792&lt;/li&gt;&lt;li&gt;FxCop compliance in the source code. Well, a little, anyway. &lt;/li&gt;&lt;li&gt;changed the string indexer on ZipFile to use case-insensitive comparisons - workitem 5740&lt;/li&gt;&lt;li&gt;ExtractAll and Extract methods on ZipFile now implicitly use the password set on the ZipFile instance.&lt;/li&gt;&lt;li&gt;AddDirectoryByName method on ZipFile - workitem 5671&lt;/li&gt;&lt;li&gt;delegate to check if reading a stream twice is ok - workitem 5829&lt;/li&gt;
&lt;/ul&gt; &lt;br&gt;fixes:&lt;br&gt;&lt;ul&gt;
&lt;li&gt;intelligently handle large files via streaming - workitem 5028&lt;/li&gt;&lt;li&gt;added exception handling in Save(); no more temp files  when an exception occurs. - workitem 5043&lt;/li&gt;&lt;li&gt;fixed a NPE problem with password-protected files of zero length. - workitem 5722&lt;/li&gt;&lt;li&gt;correctly handle files with a leading dot-slash. &lt;/li&gt;&lt;li&gt;Fixed SaveProgress event so that it actually responds to a Cancel request. Also added a working winforms example to demonstrate this.  - workitem 5558&lt;/li&gt;&lt;li&gt;Handle the case where Extract() is called immediately after Save().  - workitem 5593&lt;/li&gt;&lt;li&gt;don't produce corrupt zipfiles after Remove() - workitem 5616&lt;/li&gt;&lt;li&gt;better exceptions - workitem 5998 and 6048&lt;/li&gt;&lt;li&gt;handle .docx file (workitem 6182)&lt;/li&gt;
&lt;/ul&gt; &lt;br&gt;Some of the changes I made for FxCOP compliance, are BREAKING changes.  This means that while most old applications will just work when you just recompile them against the new library, &lt;i&gt;some&lt;/i&gt; will not.&lt;br&gt;&lt;ul&gt;
&lt;li&gt;I changed the param names of numerous methods.  If you are using Reflection to invoke the library, the different param names will cause your app to break.  I suspect this will be a small set of people, possibly zero.  The workaround is pretty simple - just use the correct param names. &lt;/li&gt;&lt;li&gt;for CLS compliance, the Crc32 class now returns Int32 for the calculated CRC, not Uint32.  &lt;/li&gt;&lt;li&gt;Some of the Exceptions have changed. &lt;/li&gt;
&lt;/ul&gt; &lt;br&gt;This release has these downloads:&lt;br&gt;&lt;ol&gt;
&lt;li&gt;&lt;b&gt;DotNetzip-src-v1.6.x.x.zip&lt;/b&gt; - the source code for the Zip Library, the setup (msi) project, and a bunch of examples. Download this if you want to play with the library, extend the example utilities, or perhaps modify and embed it into your own application. &lt;/li&gt;&lt;li&gt;&lt;b&gt;DotNetZipLib-DevKit-v1.6.zip&lt;/b&gt; - a binary release, that includes of the signed Zip Library (DLL), the XML Documentation file for intellisense, the compiled help file (CHM), and the License.   Download this if you want to write .NET applications that use the Zip library.  &lt;/li&gt;&lt;li&gt;&lt;b&gt;DotNetZipLib-RuntimeOnly-v1.6.zip&lt;/b&gt; - a binary release, that includes of the signed Zip Library (DLL), and the License.   Download this if you want to distribute .NET applications that use the Zip library, or if you want to run a .NET application that depends on this library.  &lt;/li&gt;&lt;li&gt;&lt;b&gt;DotNetZipUtils-v1.6.zip&lt;/b&gt; - a set of command-line exe utilities that rely on the library.   zipit (Creates zips), unzip (obvious), and CreateSelfExtractor.exe (creates self extracting zips).  Download this if you want command-line tools to manipulate zip files.   &lt;/li&gt;&lt;li&gt;&lt;b&gt;DotNetZipUtils-v1.6.msi&lt;/b&gt; - an installer for Windows for the command-line Zip utilities that utilize the library. This is the same stuff as the DotNetZipUtils-v1.6.zip, but in MSI form.&lt;/li&gt;&lt;li&gt;&lt;b&gt;DotNetZipLib-v1.6.chm&lt;/b&gt; - the compiled help file for the Zip library. &lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description><author>Cheeso</author><pubDate>Fri, 10 Oct 2008 05:23:51 GMT</pubDate><guid isPermaLink="false">Updated Release: 1.6 DotNetZip Library (preview) (Oct 09, 2008) 20081010052351A</guid></item><item><title>Closed Issue: Seek error when saving to Response.OutputStream in ASP.NET</title><link>http://www.codeplex.com/DotNetZip/WorkItem/View.aspx?WorkItemId=6414</link><description>With the recent update to support large files, a Save&amp;#40;&amp;#41; will result in Seek&amp;#40;&amp;#41;  calls on the output stream.  This is fine if the output is a seekable stream &amp;#40;like a memory stream or a file&amp;#41; but it does not work on streams that do not support Seek&amp;#40;&amp;#41;, such as the ASP.NET Response.OutputStream, or stdout.&lt;br /&gt;&lt;br /&gt;Please update the library to also support ASP.NET Response.OutputStream.&lt;br /&gt;Comments: fixed in change set 25205.  This fix is in the current v1.6 prelim release, will be in the v1.6 final release.</description><author>Cheeso</author><pubDate>Fri, 10 Oct 2008 05:21:27 GMT</pubDate><guid isPermaLink="false">Closed Issue: Seek error when saving to Response.OutputStream in ASP.NET 20081010052127A</guid></item><item><title>Source code checked in, #25205</title><link>http://www.codeplex.com/DotNetZip/SourceControl/ListDownloadableCommits.aspx</link><description>Fix for workitem 6414&amp;#58; support for non-seekable streams &amp;#40;like ASP.NET Response.OutputStream&amp;#41;.  This got broken with the support for large files &amp;#40;change set 25127&amp;#41;.  It&amp;#39;s fixed now. </description><author>Cheeso</author><pubDate>Fri, 10 Oct 2008 05:20:09 GMT</pubDate><guid isPermaLink="false">Source code checked in, #25205 20081010052009A</guid></item><item><title>Updated Release: 1.6 DotNetZip Library (preview) (Oct 09, 2008)</title><link>http://www.codeplex.com/DotNetZip/Release/ProjectReleases.aspx?ReleaseId=14569</link><description>&lt;div&gt;
&lt;i&gt;This is a preview release.  It will be updated regularly until such time as the release is large and stable enough to warrant a freeze.&lt;/i&gt;&lt;br&gt; &lt;br&gt;Last update: October 9, 2008.&lt;br&gt; &lt;br&gt;Major new features:&lt;br&gt;&lt;ul&gt;
&lt;li&gt;filenames/comments in Unicode or any codepage - workitem 3152 &lt;/li&gt;&lt;li&gt;add the AllowPartiallyTrustedCallersAttribute, to allow this DLL in partial trust situations, for example where your ASP.NET host specifies &amp;quot;medium&amp;quot; trust on your website. - workitem 4698&lt;/li&gt;&lt;li&gt;new method ZipEntry.OpenReader() allows applications to read an entry directly from the zip stream. - workitem 5442&lt;/li&gt;&lt;li&gt;new static method ZipFile.IsZipFile() to test a file to see if it appears to be a valid zip file. - workitem 5506&lt;/li&gt;&lt;li&gt;use the generic EventHandler model. &lt;/li&gt;&lt;li&gt;Updated the self-extractor UI to be more pleasant and adaptive.  Long comments are shown correctly. &lt;/li&gt;&lt;li&gt;events &amp;amp; cancel for ExtractAll - workitem 5792&lt;/li&gt;&lt;li&gt;FxCop compliance in the source code. Well, a little, anyway. &lt;/li&gt;&lt;li&gt;changed the string indexer on ZipFile to use case-insensitive comparisons - workitem 5740&lt;/li&gt;&lt;li&gt;ExtractAll and Extract methods on ZipFile now implicitly use the password set on the ZipFile instance.&lt;/li&gt;&lt;li&gt;AddDirectoryByName method on ZipFile - workitem 5671&lt;/li&gt;&lt;li&gt;delegate to check if reading a stream twice is ok - workitem 5829&lt;/li&gt;
&lt;/ul&gt; &lt;br&gt;fixes:&lt;br&gt;&lt;ul&gt;
&lt;li&gt;intelligently handle large files via streaming - workitem 5028&lt;/li&gt;&lt;li&gt;added exception handling in Save(); no more temp files  when an exception occurs. - workitem 5043&lt;/li&gt;&lt;li&gt;fixed a NPE problem with password-protected files of zero length. - workitem 5722&lt;/li&gt;&lt;li&gt;correctly handle files with a leading dot-slash. &lt;/li&gt;&lt;li&gt;Fixed SaveProgress event so that it actually responds to a Cancel request. Also added a working winforms example to demonstrate this.  - workitem 5558&lt;/li&gt;&lt;li&gt;Handle the case where Extract() is called immediately after Save().  - workitem 5593&lt;/li&gt;&lt;li&gt;don't produce corrupt zipfiles after Remove() - workitem 5616&lt;/li&gt;&lt;li&gt;better exceptions - workitem 5998 and 6048&lt;/li&gt;&lt;li&gt;handle .docx file (workitem 6182)&lt;/li&gt;
&lt;/ul&gt; &lt;br&gt;Some of the changes I made for FxCOP compliance, are BREAKING changes.  This means that while most old applications will just work when you just recompile them against the new library, &lt;i&gt;some&lt;/i&gt; will not.&lt;br&gt;&lt;ul&gt;
&lt;li&gt;I changed the param names of numerous methods.  If you are using Reflection to invoke the library, the different param names will cause your app to break.  I suspect this will be a small set of people, possibly zero.  The workaround is pretty simple - just use the correct param names. &lt;/li&gt;&lt;li&gt;for CLS compliance, the Crc32 class now returns Int32 for the calculated CRC, not Uint32.  &lt;/li&gt;&lt;li&gt;Some of the Exceptions have changed. &lt;/li&gt;
&lt;/ul&gt; &lt;br&gt;This release has these downloads:&lt;br&gt;&lt;ol&gt;
&lt;li&gt;&lt;b&gt;DotNetzip-src-v1.6.x.x.zip&lt;/b&gt; - the source code for the Zip Library, the setup (msi) project, and a bunch of examples. Download this if you want to play with the library, extend the example utilities, or perhaps modify and embed it into your own application. &lt;/li&gt;&lt;li&gt;&lt;b&gt;DotNetZipLib-DevKit-v1.6.zip&lt;/b&gt; - a binary release, that includes of the signed Zip Library (DLL), the XML Documentation file for intellisense, the compiled help file (CHM), and the License.   Download this if you want to write .NET applications that use the Zip library.  &lt;/li&gt;&lt;li&gt;&lt;b&gt;DotNetZipLib-RuntimeOnly-v1.6.zip&lt;/b&gt; - a binary release, that includes of the signed Zip Library (DLL), and the License.   Download this if you want to distribute .NET applications that use the Zip library, or if you want to run a .NET application that depends on this library.  &lt;/li&gt;&lt;li&gt;&lt;b&gt;DotNetZipUtils-v1.6.zip&lt;/b&gt; - a set of command-line exe utilities that rely on the library.   zipit (Creates zips), unzip (obvious), and CreateSelfExtractor.exe (creates self extracting zips).  Download this if you want command-line tools to manipulate zip files.   &lt;/li&gt;&lt;li&gt;&lt;b&gt;DotNetZipUtils-v1.6.msi&lt;/b&gt; - an installer for Windows for the command-line Zip utilities that utilize the library. This is the same stuff as the DotNetZipUtils-v1.6.zip, but in MSI form.&lt;/li&gt;&lt;li&gt;&lt;b&gt;DotNetZipLib-v1.6.chm&lt;/b&gt; - the compiled help file for the Zip library. &lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description><author>Cheeso</author><pubDate>Fri, 10 Oct 2008 05:11:10 GMT</pubDate><guid isPermaLink="false">Updated Release: 1.6 DotNetZip Library (preview) (Oct 09, 2008) 20081010051110A</guid></item><item><title>Updated Wiki: ASPNET Example 1</title><link>http://www.codeplex.com/DotNetZip/Wiki/View.aspx?title=ASPNET Example 1&amp;version=7</link><description>&lt;div class="wikidoc"&gt;
 &lt;br /&gt;This is an ASPX file that shows how to use DotNetZip in an ASP.NET page. &lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
&amp;lt;%@ Page 
    Language=&amp;quot;C#&amp;quot; 
    Debug=&amp;quot;true&amp;quot; %&amp;gt;
 
 
 
&amp;lt;%@ Import Namespace=&amp;quot;System.Text&amp;quot; %&amp;gt;
&amp;lt;%@ Import Namespace=&amp;quot;System.IO&amp;quot; %&amp;gt;
&amp;lt;%@ Import Namespace=&amp;quot;Ionic.Utils.Zip&amp;quot; %&amp;gt;
&amp;lt;%@ Import Namespace=&amp;quot;System.Collections.Generic&amp;quot; %&amp;gt;
 
&amp;lt;script language=&amp;quot;C#&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;
 
// ZipExample.aspx 
// 
// This .aspx page demonstrates how to use the DotNetZip library from within ASP.NET.
// 
// To run it, 
//  1. drop the Ionic.Utils.Zip.dll into the \bin directory of yoru asp.net app
//  2. create a subdirectory called &amp;quot;fodder&amp;quot; in your web app directory.
//  3. copy into that directory a variety of random files.
//  4. insure your web.config is properly set up (See below)
//
//
// notes:
//  This requies the .NET Framework 3.5 - because it uses the ListView control that is 
//  new for ASP.NET in the .NET Framework v3.5.  
//
//  To use this control, you must add the new web controls.  Also, you must use the v3.5 compiler. 
//  Here's an example web.config that works with this aspx file: 
// 
//    &amp;lt;configuration&amp;gt;
//      &amp;lt;system.web&amp;gt;
//        &amp;lt;trust level=&amp;quot;Medium&amp;quot; /&amp;gt;
//        &amp;lt;compilation defaultLanguage=&amp;quot;c#&amp;quot; /&amp;gt;
//        &amp;lt;pages&amp;gt;
//          &amp;lt;controls&amp;gt;
//            &amp;lt;add tagPrefix=&amp;quot;asp&amp;quot; namespace=&amp;quot;System.Web.UI.WebControls&amp;quot; assembly=&amp;quot;System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot; /&amp;gt;
//          &amp;lt;/controls&amp;gt;
//        &amp;lt;/pages&amp;gt;
//      &amp;lt;/system.web&amp;gt;
//      &amp;lt;system.codedom&amp;gt;
//        &amp;lt;compilers&amp;gt;
//          &amp;lt;compiler language=&amp;quot;c#;cs;csharp&amp;quot; extension=&amp;quot;.cs&amp;quot; warningLevel=&amp;quot;4&amp;quot; type=&amp;quot;Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&amp;quot;&amp;gt;
//            &amp;lt;providerOption name=&amp;quot;CompilerVersion&amp;quot; value=&amp;quot;v3.5&amp;quot; /&amp;gt;
//            &amp;lt;providerOption name=&amp;quot;WarnAsError&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;
//          &amp;lt;/compiler&amp;gt;
//        &amp;lt;/compilers&amp;gt;
//      &amp;lt;/system.codedom&amp;gt;
//    &amp;lt;/configuration&amp;gt;
//    
//    
// If you use medium trust, then you will need v1.6 of DotNetZip, at a minimum.
//
 
 
 
 
public String width = &amp;quot;100%&amp;quot;;
 
public void Page_Load (Object sender, EventArgs e)
{
    try
    {
        if ( !Page.IsPostBack ) {
            // populate the dropdownlist
            // must have a directory called &amp;quot;fodder&amp;quot; in the web app 
            String homeDir = Server.MapPath(&amp;quot;.&amp;quot;);
            String sMappedPath= Server.MapPath(&amp;quot;fodder&amp;quot;);
        
            var fqFilenames= new List&amp;lt;String&amp;gt;(System.IO.Directory.GetFiles(sMappedPath));
            var filenames= fqFilenames.ConvertAll((s) =&amp;gt; { return s.Replace(sMappedPath+&amp;quot;\\&amp;quot;, &amp;quot;&amp;quot;); });
 
            ErrorMessage.InnerHtml = &amp;quot;&amp;quot;;
 
            FileListView.DataSource = filenames;
            FileListView.DataBind();
        }
 
    }
    catch (Exception) 
    {
        // Ignored
    }
}
 
 
public void btnGo_Click (Object sender, EventArgs e)
{
    ErrorMessage.InnerHtml =&amp;quot;&amp;quot;;   // debugging only
    var filesToInclude= new System.Collections.Generic.List&amp;lt;String&amp;gt;();
    String sMappedPath= Server.MapPath(&amp;quot;fodder&amp;quot;);
    var source= FileListView.DataKeys as DataKeyArray ;
 
    foreach (var item in  FileListView.Items) 
    {
        CheckBox chkbox= item.FindControl(&amp;quot;include&amp;quot;) as CheckBox ;
        Label lbl= item.FindControl(&amp;quot;label&amp;quot;) as Label ;
 
        if (chkbox!=null  &amp;amp;&amp;amp; lbl != null)
        {
            if (chkbox.Checked)
            {
                ErrorMessage.InnerHtml += String.Format(&amp;quot;adding file: {0}&amp;lt;br/&amp;gt;\n&amp;quot;, lbl.Text);
 
                filesToInclude.Add(System.IO.Path.Combine(sMappedPath,lbl.Text));
            }
        }
    }
 
    if (filesToInclude.Count==0)
    {
        ErrorMessage.InnerHtml += &amp;quot;You did not select any files?&amp;lt;br/&amp;gt;\n&amp;quot;;
 
    }
    else
    {
        Response.Clear();
 
        System.Web.HttpContext c= System.Web.HttpContext.Current;
        String ReadmeText= String.Format(&amp;quot;README.TXT\n\nHello!\n\nThis is a zip file that was dynamically generated at {0}\nby an ASP.NET Page running on the machine named '{1}'.\nThe server type is: {2}\n&amp;quot;, 
                                         System.DateTime.Now.ToString(&amp;quot;G&amp;quot;),
                                         System.Environment.MachineName,
                                         c.Request.ServerVariables[&amp;quot;SERVER_SOFTWARE&amp;quot;]
                                         );
        string archiveName= String.Format(&amp;quot;archive-{0}.zip&amp;quot;, DateTime.Now.ToString(&amp;quot;yyyy-MMM-dd-HHmmss&amp;quot;)); 
        Response.ContentType = &amp;quot;application/zip&amp;quot;;
        Response.AddHeader(&amp;quot;content-disposition&amp;quot;, &amp;quot;filename=&amp;quot; + archiveName);
  
        using (ZipFile zip = new ZipFile(Response.OutputStream))
        {
            foreach (var f in filesToInclude)
            {
                zip.AddFile(f, &amp;quot;files&amp;quot;);
            }
            zip.AddFileFromString(&amp;quot;Readme.txt&amp;quot;, &amp;quot;&amp;quot;, ReadmeText);
            zip.Save();
        }
        Response.End();
    }
 
}
 
&amp;lt;/script&amp;gt;
 
 
 
&amp;lt;html&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;style/basic.css&amp;quot;&amp;gt;
  &amp;lt;/head&amp;gt;
 
  &amp;lt;body&amp;gt;
 
    &amp;lt;form id=&amp;quot;Form&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;
 
      &amp;lt;h3&amp;gt; &amp;lt;span id=&amp;quot;Title&amp;quot; runat=&amp;quot;server&amp;quot; /&amp;gt;Zip Files from ASP.NET &amp;lt;/h3&amp;gt;
 
      &amp;lt;p&amp;gt;This page uses the .NET Zip library 
      (see &amp;lt;a href=&amp;quot;http://www.codeplex/com/DotNetZip&amp;quot;&amp;gt;http://www.codeplex/com/DotNetZip&amp;lt;/a&amp;gt;) 
       to dynamically create a zip archive, and then download it to the browser through Response.OutputStream&amp;lt;/p&amp;gt;
 
      &amp;lt;span class=&amp;quot;SampleTitle&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Check the boxes to select the files, then click the button to zip them up.&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt;
      &amp;lt;br/&amp;gt;
      &amp;lt;br/&amp;gt;
      &amp;lt;asp:Button id=&amp;quot;btnGo&amp;quot; Text=&amp;quot;Zip checked files&amp;quot; AutoPostBack OnClick=&amp;quot;btnGo_Click&amp;quot; runat=&amp;quot;server&amp;quot;/&amp;gt;
   
      &amp;lt;br/&amp;gt;
      &amp;lt;br/&amp;gt;
      &amp;lt;span style=&amp;quot;color:red&amp;quot; id=&amp;quot;ErrorMessage&amp;quot; runat=&amp;quot;server&amp;quot;/&amp;gt;
      &amp;lt;br/&amp;gt;
 
      &amp;lt;asp:ListView ID=&amp;quot;FileListView&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;
 
        &amp;lt;LayoutTemplate&amp;gt;
          &amp;lt;table&amp;gt;
            &amp;lt;tr ID=&amp;quot;itemPlaceholder&amp;quot; runat=&amp;quot;server&amp;quot; /&amp;gt;
          &amp;lt;/table&amp;gt;
        &amp;lt;/LayoutTemplate&amp;gt;
 
        &amp;lt;ItemTemplate&amp;gt;
          &amp;lt;tr&amp;gt;
            &amp;lt;td&amp;gt;&amp;lt;asp:Checkbox ID=&amp;quot;include&amp;quot; runat=&amp;quot;server&amp;quot;/&amp;gt;&amp;lt;/td&amp;gt;
            &amp;lt;td&amp;gt;&amp;lt;asp:Label id=&amp;quot;label&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;&amp;lt;%# Container.DataItem %&amp;gt;&amp;quot; /&amp;gt;&amp;lt;/td&amp;gt;
          &amp;lt;/tr&amp;gt;
        &amp;lt;/ItemTemplate&amp;gt;
 
        &amp;lt;EmptyDataTemplate&amp;gt;
          &amp;lt;div&amp;gt;Nothing to see here...&amp;lt;/div&amp;gt;
        &amp;lt;/EmptyDataTemplate&amp;gt;
 
      &amp;lt;/asp:ListView&amp;gt;
 
 
    &amp;lt;/form&amp;gt;
 
  &amp;lt;/body&amp;gt;
 
&amp;lt;/html&amp;gt;
 
&lt;/pre&gt; &lt;br /&gt;
&lt;/div&gt;</description><author>Cheeso</author><pubDate>Fri, 10 Oct 2008 05:07:29 GMT</pubDate><guid isPermaLink="false">Updated Wiki: ASPNET Example 1 20081010050729A</guid></item><item><title>Created Issue: Seek error when saving to Response.OutputStream in ASP.NET</title><link>http://www.codeplex.com/DotNetZip/WorkItem/View.aspx?WorkItemId=6414</link><description>With the recent update to support large files, a Save&amp;#40;&amp;#41; will result in Seek&amp;#40;&amp;#41;  calls on the output stream.  This is fine if the output is a seekable stream &amp;#40;like a memory stream or a file&amp;#41; but it does not work on the ASP.NET Response.OutputStream. &lt;br /&gt;&lt;br /&gt;Please update the library to also support ASP.NET Response.OutputStream.&lt;br /&gt;</description><author>Cheeso</author><pubDate>Fri, 10 Oct 2008 04:35:35 GMT</pubDate><guid isPermaLink="false">Created Issue: Seek error when saving to Response.OutputStream in ASP.NET 20081010043535A</guid></item><item><title>Created Feature: Winforms Self-Extractor should allow the user to list the files to be extracted</title><link>http://www.codeplex.com/DotNetZip/WorkItem/View.aspx?WorkItemId=6413</link><description>When the winforms self-extractor runs, the user can see the zip comment, but cannot see the zip content.  There should be a button to allow the user to view the files to be extracted.&lt;br /&gt;</description><author>Cheeso</author><pubDate>Fri, 10 Oct 2008 04:01:11 GMT</pubDate><guid isPermaLink="false">Created Feature: Winforms Self-Extractor should allow the user to list the files to be extracted 20081010040111A</guid></item><item><title>Closed Issue: ZipIt: Subfolders showing up as password-protected when extracted with Win XP "Extract All"</title><link>http://www.codeplex.com/DotNetZip/WorkItem/View.aspx?WorkItemId=6279</link><description>Repro&amp;#58;&lt;br /&gt;&amp;#62; mkdir -p test&amp;#92;subdir&lt;br /&gt;&amp;#62; ZipIt.exe test.zip test&lt;br /&gt;open test.zip with Widows Explorer&lt;br /&gt;click Extract All Files&lt;br /&gt;&lt;br /&gt;Expected&amp;#58; Extraction with no password protection&lt;br /&gt;Observed&amp;#58; &amp;#34;File &amp;#39;subdir&amp;#39; is password protected&amp;#34;&lt;br /&gt;&lt;br /&gt;Doesn&amp;#39;t happen when extraction is done with Ionic zip lib.&lt;br /&gt;Comments: fixed in change set 25202.  This will be in the next v1.6 prelim release.  and in the v1.6 final release.</description><author>Cheeso</author><pubDate>Fri, 10 Oct 2008 03:58:33 GMT</pubDate><guid isPermaLink="false">Closed Issue: ZipIt: Subfolders showing up as password-protected when extracted with Win XP "Extract All" 20081010035833A</guid></item><item><title>Source code checked in, #25202</title><link>http://www.codeplex.com/DotNetZip/SourceControl/ListDownloadableCommits.aspx</link><description>Fix for workitem 6279&amp;#58;  &amp;#34;extract All&amp;#34; on WinXP produces a spurious message that an empty directory in the zip archive is password protected.  Turns out that if you append a trailing slash to the directory name, you don&amp;#39;t get this behavior.  Updated the ZipEntry.cs module to do this for directories. Also updated a few tests that specifically looked at directory names. &amp;#13;&amp;#10;&amp;#13;&amp;#10;This introduces a change in the behavior of DotNetZip- now, all directory names inserted into an archive will have a trailing slash.  This should be totally compatible with other zip tools. &amp;#13;&amp;#10;&amp;#13;&amp;#10;totally unrelated change&amp;#58; I also changed the name on the output assembly for the winforms example to be DotNetZip-WinformsTool. </description><author>Cheeso</author><pubDate>Fri, 10 Oct 2008 03:58:02 GMT</pubDate><guid isPermaLink="false">Source code checked in, #25202 20081010035802A</guid></item></channel></rss>