0

I'm new to c# and programming in general. I've started to create my own powerpoint plugin. I've got it to where a user can browse for a zip file but now I need to know - How do I parse information from a file within that zip or compound file in c#?

Do I have to use a library? If so how do I go about that?

  • 1
    Top google hit: http://msdn.microsoft.com/en-us/library/system.io.compression.zipfile(v=vs.110).aspx – Dylan Jul 26 '12 at 22:56
  • 1
    Welcome to StackOverflow. If an answer solves your issue, [you can accept this answer](http://meta.stackexchange.com/questions/5234). Then you can also upvote one or several answers with the gray up-arrow. – GG. Jul 26 '12 at 23:15

2 Answers2

2

As others have mentioned, the System.IO.Compression namespace has the ZipFile class for creating/extracting zip files. However, they are only available in .NET 4.5 however, which is currently only available as part of the Visual Studio 2012 RC.

See System.IO.Compression in:

Up until this point, the de-facto standard for working with zip files in .NET has been the DotNetZip Library. It is available under the open-source MS-PL license.

Also see:

Community
  • 1
  • 1
Jonathon Reinhart
  • 132,704
  • 33
  • 254
  • 328
1

To work with ZIP-files in general, use the ZipArchive class that represents a ZIP file, or the members of the static ZipFile class to work with ZIP files, and use the DeflateStream class to read the contents of a compressed file.

To easily read the contents of a binary file, use the BinaryReader class. Otherwise, use the StreamReader class for text files.

Daniel A.A. Pelsmaeker
  • 47,471
  • 20
  • 111
  • 157