PC Review


Reply
Thread Tools Rate Thread

c# vs2008 and zip files

 
 
Peted
Guest
Posts: n/a
 
      30th Oct 2008
Hello,

Using VS2008 c#, 3.5

can anyone advise me regarding interacting c# and zip files.

Im being given a zip file, with im told a definte no changing
directory structre of which i need to extract or navigate to a specfic
file that may be of different name in each zip file but should be in
the same directory structure each time.

To emilniate the need to manually unzip the contents, i want to use a
directory picker (or something) to be able to select the zip file and
directly/programatically navigate the directory structure of the zip
file, select the file in question and import it into my application.
The file is a text file.

Can i do this in c# dot net, without a 3rd party zip library. From
what i have found c# could extract a zip file contents, but not if the
zip file has directories ??

Could anyone apply thier amazing intellect to this conundrum, and
illuminate a poor wandering soul lost in the world of dotnet.


any advice appreciated

thanks

Peter




 
Reply With Quote
 
 
 
 
Göran Andersson
Guest
Posts: n/a
 
      30th Oct 2008
Peted wrote:
> Hello,
>
> Using VS2008 c#, 3.5
>
> can anyone advise me regarding interacting c# and zip files.
>
> Im being given a zip file, with im told a definte no changing
> directory structre of which i need to extract or navigate to a specfic
> file that may be of different name in each zip file but should be in
> the same directory structure each time.
>
> To emilniate the need to manually unzip the contents, i want to use a
> directory picker (or something) to be able to select the zip file and
> directly/programatically navigate the directory structure of the zip
> file, select the file in question and import it into my application.
> The file is a text file.
>
> Can i do this in c# dot net, without a 3rd party zip library. From
> what i have found c# could extract a zip file contents, but not if the
> zip file has directories ??
>
> Could anyone apply thier amazing intellect to this conundrum, and
> illuminate a poor wandering soul lost in the world of dotnet.
>
>
> any advice appreciated
>
> thanks
>
> Peter
>


The current version of the framework has no support for the zip file
format. It can compress and decompress the data streams, but not read
the file structure that contains the data streams.

You either have to write the code yourself to read the file structure,
or use third party code.

--
Göran Andersson
_____
http://www.guffa.com
 
Reply With Quote
 
Family Tree Mike
Guest
Posts: n/a
 
      30th Oct 2008
I am far from an amazing intellect, but the guys that developed sharpziplib
are:

http://www.icsharpcode.net/OpenSource/SharpZipLib/

"Peted" wrote:

> Hello,
>
> Using VS2008 c#, 3.5
>
> can anyone advise me regarding interacting c# and zip files.
>
> Im being given a zip file, with im told a definte no changing
> directory structre of which i need to extract or navigate to a specfic
> file that may be of different name in each zip file but should be in
> the same directory structure each time.
>
> To emilniate the need to manually unzip the contents, i want to use a
> directory picker (or something) to be able to select the zip file and
> directly/programatically navigate the directory structure of the zip
> file, select the file in question and import it into my application.
> The file is a text file.
>
> Can i do this in c# dot net, without a 3rd party zip library. From
> what i have found c# could extract a zip file contents, but not if the
> zip file has directories ??
>
> Could anyone apply thier amazing intellect to this conundrum, and
> illuminate a poor wandering soul lost in the world of dotnet.
>
>
> any advice appreciated
>
> thanks
>
> Peter
>
>
>
>
>

 
Reply With Quote
 
Jeff Johnson
Guest
Posts: n/a
 
      30th Oct 2008
<Peted> wrote in message news:(E-Mail Removed)...

> can anyone advise me regarding interacting c# and zip files.


Just another vote for SharpZipLib. Other than the actual compression
routines, the code's pretty easy to follow. I've modified it to add
functionality that didn't come "out of the box" and it wasn't hard at all.


 
Reply With Quote
 
Arne Vajhøj
Guest
Posts: n/a
 
      31st Oct 2008
Peted wrote:
> Using VS2008 c#, 3.5
>
> can anyone advise me regarding interacting c# and zip files.
>
> Im being given a zip file, with im told a definte no changing
> directory structre of which i need to extract or navigate to a specfic
> file that may be of different name in each zip file but should be in
> the same directory structure each time.
>
> To emilniate the need to manually unzip the contents, i want to use a
> directory picker (or something) to be able to select the zip file and
> directly/programatically navigate the directory structure of the zip
> file, select the file in question and import it into my application.
> The file is a text file.
>
> Can i do this in c# dot net, without a 3rd party zip library. From
> what i have found c# could extract a zip file contents, but not if the
> zip file has directories ??
>
> Could anyone apply thier amazing intellect to this conundrum, and
> illuminate a poor wandering soul lost in the world of dotnet.


I like SharpZipLib pointe to by several other.

If you for some reason have a problem using non-MS code you
can check if you can install the J# redistributable and use
vjslib.dll from that due to the fact that it is from MS.

Then you can use the ZIP code in java.util.zip !

Arne
 
Reply With Quote
 
Cheeso
Guest
Posts: n/a
 
      16th Nov 2008
On Oct 30, 6:31*pm, Arne Vajhøj <a...@vajhoej.dk> wrote:
> Peted wrote:
> > Using VS2008 c#, 3.5

>
> > can anyone advise me regarding interacting c# andzipfiles.

>
> > Im being given azipfile, with im told a definte no changing
> > directory structre of which i need to extract or navigate to a specfic
> > file that may be of different name in eachzipfile but should be in
> > the same directory structure each time.

>
> > To emilniate the need to manually unzip the contents, i want to use a
> > directory picker (or something) *to be able to select thezipfile and
> > directly/programatically *navigate the directory structure of thezip
> > file, select the file in question and import it into my application.
> > The file is a text file.

>
> > Can i do this in c# dotnet, without a 3rd partyziplibrary. From
> > what i have found c# could extract azipfile contents, but not if the
> >zipfile has *directories ??

>
> > Could anyone apply thier amazing intellect to this conundrum, and
> > illuminate a poor wandering soul lost in the world of dotnet.

>
> I like SharpZipLib pointe to by several other.


Also try www.codeplex.com/DotNetZip - simple and easy.
Example:

using (ZipFile zip = ZipFile.Read(ExistingZipFile))
{
foreach (ZipEntry e in zip)
{
e.Extract(TargetDirectory);
}
}


>
> If you for some reason have a problem using non-MS code you
> can check if you can install the J# redistributable and use
> vjslib.dll from that due to the fact that it is from MS.
>
> Then you can use theZIPcode in java.util.zip!
>


Don't do that. Too hard.



 
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
Re: VS2010 RC hogs VS2008 .sln files Peter Duniho Microsoft C# .NET 2 8th Apr 2010 05:04 AM
Upgrading from VS2008 standard to VS2008 Pro? ker_01 Microsoft Dot NET 0 11th Aug 2008 06:00 PM
upgrade from VS2008 standard to VS2008 pro- options? ker_01 Microsoft Dot NET 0 29th May 2008 04:42 PM
Header files problem in VS2008 Siamak Sarmady Microsoft VC .NET 2 28th Apr 2008 03:07 PM
Which RegexOptions are used by: VS2008/Edit/Find In Files/Use Regular Expressions AAaron123 Microsoft C# .NET 0 12th Apr 2008 01:48 PM


Features
 

Advertising
 

Newsgroups
 


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