Easy way to unzip zipped files?

I'm trying to figure out an easy way to unzip zipped files.  I'm using C# in VS 4.5.
I download this:
http://dotnetzip.codeplex.com/
I couldn't get any dlls installed.  I couldn't set any reference to anything.
I also tried to follow the example here:
http://www.danderson.me/posts/zipfile-class-system-io-compression-filesystem/
I can't find anything titled 'System.IO.Compression.dll'.  I set a reference to these two:
System.IO.Compression.FileSystem
System.IO.Compression
That did nothing at all.
For instance, I think this should work:
using System;
using System.IO;
using System.IO.Compression;
namespace ConsoleApplication
class Program
static void Main(string[] args)
string startPath = @"c:\example\start";
string zipPath = @"c:\example\result.zip";
string extractPath = @"c:\example\extract";
ZipFile.CreateFromDirectory(startPath, zipPath);
ZipFile.ExtractToDirectory(zipPath, extractPath);
However, i keep getting an error message that says 'The name 'ZipFile' does not exist in the current context'.
Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

Hi
Please include the below namespace and try it out.
System.IO.Compression.FileSystem
The code would be like this.
using System;
using System.IO;
namespace ConsoleApplication
class Program
static void Main(string[] args)
string startPath = @"c:\example\start";
string zipPath = @"c:\example\result.zip";
string extractPath = @"c:\example\extract";
System.IO.Compression.ZipFile.CreateFromDirectory(startPath, zipPath);
System.IO.Compression.ZipFile.ExtractToDirectory(zipPath, extractPath);
Please note that you need to add a DLL reference to the framework assembly
System.IO.Compression.FileSystem.dll
Please let me know in case of any questions you may have around this. Thank you. 

Similar Messages

  • Is there a way to open zip files on iphone5?

    Is there a way to open zip files on iphone5?

    I'll second robdrage on Readle's Documents. Also check out iZip. Dropbox will also open zip files. Any of the above will mange and allow yo to view image files.

  • Is there any easier way to edit imovie files that have been exported as mov file then added to FCE 4?? As every move I make has to be rendered and takes forever??? Also my recording is going out of focus without me touching the camera, why has this happen

    Is there any easier way to edit imovie files that have been exported as mov file then added to FCE 4?? As every move I make has to be rendered and takes forever??? Also my recording is going out of focus without me touching the camera, why has this happened any idea what causes this??
    iMovie '08, Mac OS X (10.5.8), FCE 4

    My daughter has had her Razr for about 9 months now.  About two weeks ago she picked up her phone in the morning on her way to school when she noticed two cracks, both starting at the camera lens. One goes completely to the bottom and the other goes sharply to the side. She has never dropped it and me and my husband went over it with a fine tooth comb. We looked under a magnifying glass and could no find any reason for the glass to crack. Not one ding, scratch or bang. Our daughter really takes good care of her stuff, but we still wanted to make sure before we sent it in for repairs. Well we did and we got a reply from Motorola with a picture of the cracks saying this was customer abuse and that it is not covered under warranty. Even though they did not find any physical damage to back it up. Well I e-mailed them back and told them I did a little research and found pages of people having the same problems. Well I did not hear from them until I received a notice from Fed Ex that they were sending the phone back. NOT FIXED!!! I went to look up why and guess what there is no case open any more for the phone. It has been wiped clean. I put in the RMA # it comes back not found, I put in the ID #, the SN# and all comes back not found. Yet a day earlier all the info was there. I know there is a lot more people like me and all of you, but they just don't want to be bothered so they pay to have it fix, just to have it do it again. Unless they have found the problem and only fixing it on a customer pay only set up. I am furious and will not be recommending this phone to anyone. And to think I was considering this phone for my next up grade! NOT!!!!

  • How to check & unzip zip file using java

    Dear friends
    How to check & unzip zip file using java, I have some files which are pkzip or some other zip I want to find out the type of ZIp & then I want to unzip these files, pls guide me
    thanks

    How to check & unzip zip file using java, I have
    ve some files which are pkzip or some other zip I
    want to find out the type of ZIp & then I want to
    unzip these files, pls guide meWhat do you mean "other zip"? Either they're zip archives or not, there are no different types.

  • When I unzip .zip files I get an alias ?

    I've unzipped .zip files for years, but with Lion, unzipping a .zip file (created in Snow Leopard) does not result in a set of files, it results in a set of aliases which do not point to any file when I select "Show Original."
    Any advice appreciated.

    The current version of the built-in Archive Utility has problems with some zip files. Use "The Unarchiver" instead -- free in the App Store.

  • Unzipping ZIP file - Best way

    Hi,
    I found many ways to unzip a ZIP archive,
    but which is the best way in term of performance ?
    I found some examples doing :
    ZipFile zipFile = new ZipFile( file ) ;
    Enumeration entries = zipFile.entries() ;
    while( entries.hasMoreElements() ) {
    ZipEntry entry = ( ZipEntry )entries.nextElement() ;
    // extract entry
    Others :
                   ZipEntry zipentry;
                   zipinputstream =
    new ZipInputStream(
    new FileInputStream(zipFile));
                   zipentry = zipinputstream.getNextEntry();
                   while (zipentry != null) {
    // extract entry
    zipentry = zipinputstream.getNextEntry();
    For extracting the entries I saw examples using BufferedInputStream and BufferedOutputStream
                             BufferedInputStream is =
                                  new BufferedInputStream(zipFile.getInputStream(entry));
                             int currentByte;
                             // establish buffer for writing file
                             byte data[] = new byte[1024];
                             // write the current file to disk
                             FileOutputStream fos = new FileOutputStream(destFile);
                             BufferedOutputStream dest =
                                  new BufferedOutputStream(fos, 1024);
                             // read and write until last byte is encountered
                             while ((currentByte = is.read(data, 0, 1024)) != -1) {
                                  dest.write(data, 0, currentByte);
                             dest.flush();
                             dest.close();
                             is.close();
    others using ZipInputStream and FileOutputStream :
    zipinputstream =
    new ZipInputStream(
    new FileInputStream(zipFile));
                        int n;
                        FileOutputStream fileoutputstream;
                        File newFile = new File(entryName);
                        String directory = newFile.getParent();
                        if (directory == null) {
                             if (newFile.isDirectory())
                                  break;
                        fileoutputstream =
                             new FileOutputStream(destinationname + entryName);
                        while ((n = zipinputstream.read(buf, 0, 1024)) > -1)
                             fileoutputstream.write(buf, 0, n);
                        fileoutputstream.close();
                        zipinputstream.closeEntry();
    Can u tell me which solution to use for looping through the files (by this Enumertion or by checking nextEntry is null ?)
    And for the extracting (use of BufferedInp. BufferedOutp. or ZipInputStream and FileOutputStream?) in term of performance
    Thank u for any tips
    Message was edited by:
    matt.webdev
    Message was edited by:
    matt.webdev
    Message was edited by:
    matt.webdev

    Hi there,
    Pl see code below. For example, create a file named "interest"on your c:\test\interest in notepad with your recordkey line info.
    recordKey     dollarAmount     interestRate     years
    1234          50          3          4          
    5678          60          4          5
    9876          70          5          6
    8765          80          6          7
    program below extracts recordKey line info if available in file.
    import java.io.*;
    public class SearchString
         String message = "9999";
         public static void main(String args[])
              SearchString ss = new SearchString();
              ss.searchFile("1234");
         public String searchFile(String sRecordKey)
              try
                   BufferedReader br = new BufferedReader(new FileReader("c:/test/interest.txt"));
                   String str = "";
                   while((str = br.readLine()) != null)
                             // passing a specific recordKey to search
                             if (str.indexOf("5678") != -1)
                                       System.out.println(str);
                                       message = str;
              catch (IOException e)
                   System.out.println("Could Not Search File");
              return message;

  • Auto unzip "zipped" files inside OWB. possible?

    Scenario:
    Client will be placing large fixed-delimited files in a directory w/c are in ZIPPED format. This file directory will be my source location.
    Question?
    Is there a way to automate the process of unzipping the files in OWB and placing it in the same directory. I am thinking of using a process flow but I cannot find any utility activity for this. Any suggestions?
    Thanks
    -carlo

    I haven't done it for a while, but I manage to archive files from the workflow via a script.
    In the workflow you have to use the ExternalProcess command.

  • I'm running Firefox 7.0.1 and since the September 30 security update I can no longer unzip zipped files unless I reboot my computer first or run it in Safe Mode. Can anyone help me roll Firefox back to before the update?

    I regularly download zipped files from Survey Monkey. Since the latest security update, the zipped files download to my computer, but when I try and unzip them I get a message telling me the file is in use by another application. If I reboot, I can unzip the file, or if I'm in Safe Mode when I download the file it unzips fine.
    I have tried three different unzip apps and all have the same trouble. Everything was working well after the September 5 update.
    I'm running Windows XP with McAfee antivirus, Spybot, Ad-Aware and Malbytes Anti-malware. All are up to date.

    The URL below is to Adobe's Acrobat update page.
    There you'll find each of the incremental updates to Acrobat 10.
    They must be installed one at a time in sequence. 
      http://www.adobe.com/support/downloads/product.jsp?product=1&platform=Windows
    Now, if after attempted updates fail then you'll need to speak with your IT Department.
    You need your install of Acrobat 10 updated to dot version 10.1.7.
    Be well...
    Message was edited by: CtDave

  • Easy way to trim audio files?

    I am trying to create a movie with reeldirector, and I would like to use segments of 3 different songs, but I cannot trim the audio to the proper length. Anyone know an easy way to either a)edit the audio with reeldirector, or b)create a new song file that is a trimmed version of the original. I would like to do this on my iPhone 4 and not deal with iTunes.

    There is currently no way to trim audio files with reeldirector, but I found a workaround. I had to cut each audio file to length using the free program Audacity (I use a PC). The shortened songs could then be inserted into reeldirector at the appropriate times. iTunes could cut the song to length, but it does not change the time stamp of the song. This caused problems when I imported into reeldirector. It was much easier to cut the song in Audacity, and then import to iTunes, and then to my iPhone. It was the long way around, but the final result is very nice.

  • Easier way to rename music files and locate them with iTunes? Help, please!

    A while back, I used a 3rd party software (Yamipod) to move all my music off of my video ipod to a new computer. Yamipod converted all of my music file names to read "album name - artist - song name", instead of how iTunes imports music "01 song name". Yamipod also created a sub-folder "1" for each album the artist has in my iTunes music folder.
    For example, when in my iTunes music folder, if I click on Justin Timberlake, it will show the two albums I have "FutureSex" and "Justified". If I click on "Justified" it shows a folder "1" which I have to click on to get to the song which is then named "Justified - Justin Timberlake - Rock Your Body" instead of "06 Rock Your Body"
    When in my iTunes folder, a lot of my music cannot be found (even though it is not technically lost), so I manually have to click through all my iTunes music folders to "re-attach" the file so iTunes can then play the music.
    Here's what I am looking for:
    1. I want to rename all of my music files back to iTunes format of "track # song name" (i.e. 06 Rock Your Body) without manually retyping every song title.
    2. An easier way for iTunes to "find" all of my music instead of me manually pointing to each and every file. I have all the music, I just have to manually show iTunes where each of the 1600+ songs is located, which is a long and tedious process that I do not have the time or patience for.
    I would greatly appreciate any advice on how to manage this without going bonkers.
    Thank you!!

    Well, the one problem you have is that for the "Move" function, the source file input should be wired to the output of the "Build Path" function, not to the duplicate path out of the "List" function. Also, you need to pass the error cluster around with a shift register. Otherwise you will not catch an error that may have occurred during one of the file rename operations.

  • Unzip - zip file

    Can any one give some info regarding extracting a uploaded zip file on server from my web application..
    my environment is...
    IBM websphere
    Struts frame work.
    My uploaded zip file contains some excel sheets and some images.
    each image name is mentioned in excel sheet.
    I need to migrate the contents in excel to database.
    My each excel sheet contains a Learning Course for a online exam with couple of Questions.
    each Question in may containg some image.
    so, my problem is uploading the contents of course in excel sheet to database along with images names as
    course1_question1_imagename.gif
    I am expecting some suggestions and help from the FORUMS.

    I am expecting some suggestions and help from the
    FORUMS.
    good luck

  • Quick and easy way to encode video files?

    With out using another application.

    An easy and simple way you can do this is by using Finder. It might not be the best option, depending on what you need but try it out.
    Control+Click on the file and select > Encode Selected Video Files
    You can choose from 480p, 720p, 1080p, Audio Only, or  Apple ProRes under the Settings drop down menu.
    Then choose whether you want to Encode for higher quality or greater compatability.
    When you have selected your settings the window will tell you the Format, Resolution, Date rate and what it compatible with. The 480p, 720p and 1080p will use H.264 compression which is highly compressed and probably what you want to choose to compress your file.
    After you have selected your settings select the destionation and if you want to delete the source file and click continue.
    Done. Easy and simple, done right in finder.

  • Is there an easier way to open photo files that were stored in my backup as Document Files besides changing the extension on each of the photos?

    I did a backup on my mac of my phone.  Then I got a new phone.  I don't want to put all of my old photos on the new phone.  So, I went to the backup to access the photos so that I could work with them in jpeg form on my computer.  I have done this in the past with no problem. This time, when I go to access the photos they are all document files.  I need them to be jpeg files.  Is there a way to open then as jpegs without opening each individual file and updating the file extension?  Also,  why did this happen?  I recall doing this with my prior iphone and the photos were jpegs and I didn't have to do anything.
    Thanks!

    Howdy,
    This is a really good question about one of the bigger challenges of building a 3D project. When you add objects to the Canvas (including drawing), they get added in the camera's viewspace, facing the camera and sharing the same up-vector (i.e. positive Y is up). This is all well and good, but what about doing what you ask, where you want to add an object in the localspace of another object? Let's look at your example: adding a shape that is coplanar to a photo, with the camera not necessarily aligned with the photo.
    As Mark suggested, you can draw the shape in the camera's viewspace and then drag-and-drop the Position and Rotation channels from the photo onto the shape. This will replace the shape's Position and Rotation values with that of the photo, making them coplanar and located in the same place. The shortcoming of this method is that you draw the shape at a size that seems correct in the Canvas, but once it's moved to the same place as the photo, it will often turn out to be too small or large. Then you have to make further tweaks.
    Another solution is to use the Isolate command. Isolate temporarily aligns the current view to the selected object and solos that object. So you could isolate the photo and then draw the shape in the Canvas and it will be coplanar with the photo. The only caveat is that the moment you finish drawing the shape, it will disappear. This is because the photo is still isolated (and soloed). As soon as you de-isolate the photo, everything will reappear.
    The easiest way to use Isolate for new photos—not ones already in the project—is to place the photo in a 3D group, position the group where you want the photo and shape to be, then isolate the group and add anything you want to it (shapes, image, text, etc).

  • Easy way to rename all files and folders in a specific directory

    hy all,
    i want to rename all files&folders in a specified folder... i only want to replace all "_'_" with an"-" in all file names...
    example:
    TCHK1_B4194W01PF7_NMOSi_D_B__3_50ohm-500ohm_03-29-07_10'46'23_AM.tst
    TCHK1_B4194W01PF7_NMOSi_D_B__3_50ohm-500ohm_03-29-07_10-46-23_AM.tst
    i cant change the timeformat because this are automatically generated files from an external program...
    this is my program(attached as JPG) but it doesnt work...i get allways "error 10-duplicate path" or "error1 -   An input parameter is invalid"
    could sombody please help me... i think its an easy VI but i cant get it working
    THANKS in advance!!!!
    greets
    Andreas
    Attachments:
    renamefolder.JPG ‏20 KB

    Well, the one problem you have is that for the "Move" function, the source file input should be wired to the output of the "Build Path" function, not to the duplicate path out of the "List" function. Also, you need to pass the error cluster around with a shift register. Otherwise you will not catch an error that may have occurred during one of the file rename operations.

  • An easy way to play wav files on a java program

    Hey. I would like to include a wav file to my program, but so far have not succeeded (Is there a way to do this without using applets)
    Please, post me a code that can be used without knowing too much about programming!

    Please, post me a code that can be used without knowing too much about programming! Hopefully you can read tutorials.
    Read the tutorial on [url http://java.sun.com/docs/books/tutorial/]Sound.

Maybe you are looking for

  • IMac Display Issues Not Resolved

    The Apple Store at La Cantera in San Antonio Needs Help! I purchased my first personal iMac on May 17, 2006. It was a reconditioned model. Granted, I work for a very large urban school district in technology, I decided that the Intel Mac was for me.

  • I am trying to build an applicaton but the build can't find SMTPEmail.mnu

    Using Labview 2013 on a Window 7 machine, I get an build error when the aplication builder cant find SMTPEmail.mnu,, but my application does not use SMTP at all, so What the ????

  • Taskbar / Window Colour Not Matching

    When personalising Windows 10 the colour of the Windows and the Taskbar are not matching up as intended. I have the colour set to a light blue however the task bar is a dark blue. I'm unsure if this is my doing of a bug in windows but i cannot seem t

  • Two movies that I have rented on my ipad wouldn't play to my appleTV.

    I get sounds and error message "The connected display is not authorised to play movie". I get sound but picture only for a split second, then blank and the error message above. Tried some fixes suggested online but didn't work. Thanks for refund, but

  • Trying to learn Applescript

    I am referencing this 'guide': Adobe Illustrator CS6 Scripting  Reference: AppleScript I am trying some of the examples in this guide with my copy of CS6 and have yet to get a single example to do anything. Clearly I am missing something ridiculously