Udostępnij za pośrednictwem


More .Net Zip Library/Utility updates

[Update: this code has been moved to a codeplex project:   <www.codeplex.com/DotNetZip> .  Go there for the latest source for ths .NET Zip/compression library. It does ZIP, ZIP64, SFX, passwords, unicode, and streams. All zips are fully interoperable. ]  

I updated the Zip library again, this time to support the adding of fully qualified files or directories.

A couple people commented that the library did not handle fully-qualified pathnames properly.  Hmmm, I guess I need to embrace Test Driven Development a little more tightly eh?  The zipfile that got produced would be un-readable by Windows. 

I've changed the zip library to correct that.

Comments

  • Anonymous
    June 06, 2007
    I'm trying to use this library, but when I call AddFile("C:/1/2/3/image.png") the resulting zip has folders 1/2/3 and then image.png inside of there. How can I just get it to add image.png to the zip without the folder structure?

  • Anonymous
    June 07, 2007
    One way is to change the current working directory to the given directory, and then zip the image.png file.   another way is to zip files that are only in the local directory.  

  • Anonymous
    June 07, 2007
    How do I change the current working directory?

  • Anonymous
    June 11, 2007
    http://msdn2.microsoft.com/en-us/library/system.io.directory.setcurrentdirectory.aspx Keep in mind the current directory is application-scoped.  When you set it with this class lib, the current directory applies to the entire process. -Dino