?
Solved

zip file open and reading in C#

Posted on 2014-09-05
4
Medium Priority
?
380 Views
Last Modified: 2014-09-11
hi - I'm using VS2010 and .net 4.0 and for program reasons can't upgrade to 4.5. I'm trying to open and read the contents of a zip file so that I can create a data set internal to my program (ie I have no need to create the rest of the zip operation of placing unzipped files somewhere.) I've looked at the Microsoft example code in their Package class that deals with zips and there is reference to an attribute that's not explained. specifically, in the foreach statement to get relationships, the line reads"\
"foreach ( PackageRelationship relationship in documentPart.GetRelationshipByType(ResourceRelationshipType))
the ResourceRelationshipType is undefined if I compile as is. the method is calling for a string, but I don't know where to find the ResourceRelationshipTypes list.
any suggestions?
thanks,
0
Comment
Question by:jdcoburn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 36

Expert Comment

by:Miguel Oz
ID: 40307118
Please consider using dotnetzip library, for you case:
using (ZipFile zip = ZipFile.Read(ExistingZipFile))
{
  foreach (ZipEntry e in zip)
     System.Console.WriteLine(e.FileName); //You could add it to a list, etc.
}

Open in new window

Note: The code sample is a simplified version of Nicholas Carey's answer.
0
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 2000 total points
ID: 40307523
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 40310089
Can you provide a link to the page that has the code example?
0
 

Author Closing Comment

by:jdcoburn
ID: 40317796
it worked fine, but I had to modify several methods to get it to work.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question