PC Review


Reply
Thread Tools Rate Thread

C# unzipping .ZIP files

 
 
William S
Guest
Posts: n/a
 
      4th May 2009
Hello

Anyone have any exeriance using C# and pkunzip? I'm writing up a C# app
that may have to extract files from a .ZIP archieve. The files will be
zipped up, and I'll need to unzip hem and put them in the path there are
zipped up in. My question how can i do that, or is it possiable?





 
Reply With Quote
 
 
 
 
Marty Honea
Guest
Posts: n/a
 
      4th May 2009
I've not had to do it in C# yet, but I've used this product in the past with
Clarion.

http://www.lindersoft.com/products_lszip.htm

Friedrich Linder writes some fantastic stuff, and is very responsive when
asked questions. I wouldn't hesitate to use anything he wrote.

He says on his website this works with C++, so if he doesn't have a C#
version you could still use it with InteropServices.

Marty

"William S" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello
>
> Anyone have any exeriance using C# and pkunzip? I'm writing up a C# app
> that may have to extract files from a .ZIP archieve. The files will be
> zipped up, and I'll need to unzip hem and put them in the path there are
> zipped up in. My question how can i do that, or is it possiable?
>
>
>
>
>



 
Reply With Quote
 
Arne Vajhøj
Guest
Posts: n/a
 
      4th May 2009
William S wrote:
> Anyone have any exeriance using C# and pkunzip? I'm writing up a C# app
> that may have to extract files from a .ZIP archieve. The files will be
> zipped up, and I'll need to unzip hem and put them in the path there are
> zipped up in. My question how can i do that, or is it possiable?


You should be able to do that using either the J# lib or
the open source #ZipLib.

I believe I have some examples if you are interested.

Arne
 
Reply With Quote
 
Jesse Houwing
Guest
Posts: n/a
 
      4th May 2009
Hello William,

> Hello
>
> Anyone have any exeriance using C# and pkunzip? I'm writing up a C#
> app that may have to extract files from a .ZIP archieve. The files
> will be zipped up, and I'll need to unzip hem and put them in the path
> there are zipped up in. My question how can i do that, or is it
> possiable?



have a look at:
http://www.icsharpcode.net/OpenSource/SharpZipLib/

alternatively, you can hook into the J# library which comes with Zip Support
out of the box
http://aspalliance.com/1269_Zip_and_...ng_J_libraries

--
Jesse Houwing
jesse.houwing at sogeti.nl


 
Reply With Quote
 
Moe Sisko
Guest
Posts: n/a
 
      5th May 2009

"William S" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Anyone have any exeriance using C# and pkunzip? I'm writing up a C# app
> that may have to extract files from a .ZIP archieve. The files will be
> zipped up, and I'll need to unzip hem and put them in the path there are
> zipped up in.


I've used this (free) library before without problems :

http://www.codeplex.com/DotNetZip




 
Reply With Quote
 
harry
Guest
Posts: n/a
 
      5th May 2009


The command line add-on makes it easy to zip & unzip from your program

http://www.pkware.com/index.php?opti...d=56&Itemid=98

harry

 
Reply With Quote
 
Arne Vajhøj
Guest
Posts: n/a
 
      7th May 2009
Mark Rae [MVP] wrote:
> "William S" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Anyone have any exeriance using C# and pkunzip? I'm writing up a C#
>> app that may have to extract files from a .ZIP archieve. The files
>> will be zipped up, and I'll need to unzip hem and put them in the path
>> there are zipped up in. My question how can i do that, or is it
>> possiable?

>
> I use this exclusively: http://www.chilkatsoft.com/zip-dotnet.asp


What makes it better than the gratis alternatives.

Arne
 
Reply With Quote
 
Cheeso
Guest
Posts: n/a
 
      16th May 2009
> > What makes it better than the gratis alternatives.

DotNetZip is one of those gratis alternatives for handling ZIP files.
It's a 100% managed code library to read, create, and update zip files
from within any .NET application.
It does zip passwords, zip passwords with AES encryption, ZIP64,
Unicode, self-extracting archives, and more. There's a good help file
with lots of examples (online version here:http://
cheeso.members.winisp.net/DotNetZipHelp/ ). There's also a support
forum on codeplex.

Here's some sample code to extract all files from a zip to a
particular directory, without overwriting existing files:

String TargetDirectory= "c:\\unpack";
using(Ionic.Zip.ZipFile zip= Ionic.Zip.ZipFile.Read
(ZipFileToExtract))
{
zip.ExtractAll(TargetDirectory,
Ionic.Zip.ExtractExistingFileAction.DontOverwrite);
}

Sample to extract entries conditionally, and overwrite any existing
files:

using (var zip1 = Ionic.Zip.ZipFile.Read(zipToUnpack))
{
foreach (var entry in zip1)
{
// extract only the entries I want:
if (wantExtract(entry.FileName))
entry.Extract(dir,
Ionic.Zip.ExtractExistingFileAction.OverwriteSilently);
}
}


Sample code to create a zip file, zipping up a directory:

using (var zip = new Ionic.Zip.ZipFile())
{
zip.AddDirectory(directory, System.IO.Path.GetFileName
(directory));
zip.Save(targetZip);
}

Sample to create a self-extracting archive (SFX):
using (var zip = new Ionic.Zip.ZipFile())
{
zip.AddDirectory(directory, System.IO.Path.GetFileName
(directory));
zip.Comment = "This will be embedded into a self-extracting
console-based exe";
zip.SaveSelfExtractor("archive.exe",
SelfExtractorFlavor.ConsoleApplication);
}

DotNetZip can also produce a Windows GUIs for the SFX.

check it out. http://dotnetzip.codeplex.com.

(DotNetZip is free.)
 
Reply With Quote
 
Cheeso
Guest
Posts: n/a
 
      16th May 2009
> > What makes it better than the gratis alternatives.

DotNetZip is one of those gratis alternatives for handling ZIP files.
It's a 100% managed code library to read, create, and update zip files
from within any .NET application.
It does zip passwords, zip passwords with AES encryption, ZIP64,
Unicode, self-extracting archives, and more. There's a good help file
with lots of examples (online version here:http://
cheeso.members.winisp.net/DotNetZipHelp/ ). There's also a support
forum on codeplex.

Here's some sample code to extract all files from a zip to a
particular directory, without overwriting existing files:

String TargetDirectory= "c:\\unpack";
using(Ionic.Zip.ZipFile zip= Ionic.Zip.ZipFile.Read
(ZipFileToExtract))
{
zip.ExtractAll(TargetDirectory,
Ionic.Zip.ExtractExistingFileAction.DontOverwrite);
}

Sample to extract entries conditionally, and overwrite any existing
files:

using (var zip1 = Ionic.Zip.ZipFile.Read(zipToUnpack))
{
foreach (var entry in zip1)
{
// extract only the entries I want:
if (wantExtract(entry.FileName))
entry.Extract(dir,
Ionic.Zip.ExtractExistingFileAction.OverwriteSilently);
}
}


Sample code to create a zip file, zipping up a directory:

using (var zip = new Ionic.Zip.ZipFile())
{
zip.AddDirectory(directory, System.IO.Path.GetFileName
(directory));
zip.Save(targetZip);
}

Sample to create a self-extracting archive (SFX):
using (var zip = new Ionic.Zip.ZipFile())
{
zip.AddDirectory(directory, System.IO.Path.GetFileName
(directory));
zip.Comment = "This will be embedded into a self-extracting
console-based exe";
zip.SaveSelfExtractor("archive.exe",
SelfExtractorFlavor.ConsoleApplication);
}

DotNetZip can also produce a Windows GUIs for the SFX.

check it out. http://dotnetzip.codeplex.com.

(DotNetZip is free.)
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
unzipping files shirley2005craft Windows XP General 1 24th Nov 2008 10:31 PM
Unzipping FIles - Help Please =?Utf-8?B?QWxhbg==?= Microsoft Access VBA Modules 4 24th Sep 2007 06:56 PM
unzipping files =?Utf-8?B?R0VPUkdJQQ==?= Microsoft Excel Programming 10 8th Aug 2005 03:49 PM
unzipping files Loyd Windows XP Help 1 1st Dec 2003 01:04 AM
Unzipping files Greg Newbloom Microsoft Windows 2000 File System 2 27th Oct 2003 08:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:33 PM.