473,407 Members | 2,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

c# vs2008 and zip files

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


Oct 30 '08 #1
6 6204
"Peted" wrote in message news:5c********************************@4ax.com...
Can I do this in C# 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 .NET?
According to Peter Bromberg, whose amazing intellect is well known round
these parts, this is not possible natively.
http://www.eggheadcafe.com/tutorials...ers-and-f.aspx

Peter's article suggests using this 3rd-party utility:
http://www.icsharpcode.net/OpenSource/SharpZipLib/

FWIW, I use this one: http://www.chilkatsoft.com/zip-features.asp
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Oct 30 '08 #2
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
Oct 30 '08 #3
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


Oct 30 '08 #4
<Petedwrote in message news:5c********************************@4ax.com...
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.
Oct 30 '08 #5
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
Oct 31 '08 #6
On Oct 30, 6:31*pm, Arne Vajhøj <a...@vajhoej.dkwrote:
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.

Nov 16 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Frank Rizzo | last post by:
Before I download and install 2008, I have a question. One of the selling points of 2008 is multi-targeting. I work on a team where everyone uses vs2005. Can I use vs 2008 for development and...
8
by: Joe Withawk | last post by:
I have a solution consisting of a c# project as win application and a c++ project as classlibrary. Both are .net 2.0 The classlibrary handles some loading of quicktime movies, but that should not...
20
by: Iouri | last post by:
Hi everybody, We are currently using VS2003 and now we are in the porcess of upgrading to the next Visual Studio version. Does somebody have a real life experience with VS2008? My boss wants to...
7
by: dan | last post by:
I'm working on a small Web project in VS2008. In VS2005 it was recommended that DataSet be placed in App_Data folder (the framework did that automatically). In VS2008 the framework does not give...
4
by: K Viltersten | last post by:
We have a project working well today and it's developed on VS2005. Since we're planing to switch to VS2008 in a soon future, i've been trying to move the project to VS2008 Express (Web...
8
by: Red | last post by:
If auto-format is turned off in VS2008, there is apparently no way to indent a line. Under Tools->Options->Text Editor->C#->Formatting, there are three checkboxes. Unchecking those seems to cause...
2
by: Chris Freeman | last post by:
I'm sure I am missing something stupid. When I debug my VS2008 Asp.Net project the .c file is locked and I can not edit it. I use to do this in VS2005. Anyone have an idea what changed? Chris
16
by: Harry Simpson | last post by:
I've been away from ASPNET - I open up a new Web app in VS2008 and go into properties and select to use IIS instead of the personal web server. Then I run in debug mode and it says I have to set...
3
by: Greg Smith | last post by:
Has something changed in vc2008 ASP? When I add a class file and put namespaces in it they are not visible from other page code files. I imported an old vs2005 app into vs2008 and it still...
0
by: kzWS08 | last post by:
Hope someone can help. I am attempting to include Crytal Reports Basic for Visual Studio 2008 as prerequisite for my .Net 2.0 windows form application on Vista/XP. Whether I select "... download...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.