Lo-Fi unzipping functionality for .net
I’ve looked for unzipping functionality for .net a couple of times over the years and never found a totally satifactory solution.
In a recent project I had to grab an attachment from a POP box and then unzip the attachment.
I found an unzipping product called 7zip, it’s open source and there’s a command line version. See their downloads page for the commandline version - http://www.7-zip.org/download.html
Once you have this exe on your server you can easily unzip a file using the following code:
dim pathToZip as string = "c:\some\folder\file.zip"
Dim p As Process = Process.Start("C:\Program Files\7Zip\7za.exe", "e " & pathToZip & " -oc:\")
p.WaitForExit()
Obviously you are not limited to just unzipping, you can do anything the command line version does: zip, password protect a zip file, list the contents, etc
This entry was posted by nerdboy on Thursday, October 2nd, 2008 at 2:10 pm and is filed under asp.net. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response below, or trackback from your own site.