How do I Handle .zip files?
I have been working on a program and I need it to unzip a zip file. Can anyone help me? Thank you!
I tried handling a zip file as a directory but that didn't work.
It wouldn't hurt if I could compress files into a zip file to! But I need unzipping the file first.
This is my code handling it as a directory:
Code:
Dim count As Integer = Directory.GetFiles(My.Application.Info.DirectoryPath & "\Games\" & game & "\000.zip").Length
MessageBox.Show(count)
It has an error saying it is not a valid directory name.
Re: How do I Handle .zip files?
ZIP files are not directories. That's just a nicety provided by Windows Explorer. There is no support built into the .NET Framework for ZIP files. You can either write your own code to handle them at the Stream level or else use a third-part component. I strongly recommend the second option. There are various components available but DotNetZip is very simple to use and it's free.
Re: How do I Handle .zip files?
Look into using SharpZipLib.
Re: How do I Handle .zip files?
Thank you! I will be sure to check that out :)
Re: How do I Handle .zip files?
Quote:
Originally Posted by
formlesstree4
Look into using SharpZipLib.
I've used both, although neither extensively, and, while I wouldn't say that SharpZipLib is bad at all, I do think that DotNetZip is the simpler to use.