C# Zip/Unzip

Discussion in 'Programming' started by Felu, May 5, 2007.

  1. #1
    Does anyone out there know how can i zip and unzip files using C#? I've googled but didn't find something useful :(.

    All useful replies will appreciated and will be given a +rep :).
     
    Felu, May 5, 2007 IP
  2. ndreamer

    ndreamer Guest

    Messages:
    339
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #2
    ndreamer, May 6, 2007 IP
    Felu likes this.
  3. TwistMyArm

    TwistMyArm Peon

    Messages:
    931
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #3
    TwistMyArm, May 6, 2007 IP
  4. Felu

    Felu Peon

    Messages:
    1,680
    Likes Received:
    124
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Felu, May 10, 2007 IP
  5. TwistMyArm

    TwistMyArm Peon

    Messages:
    931
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I don't see that zLib code being for C# explicitly, while that's exactly what the link I gave you is for. Plus, almost by the license's definition it comes with code, right?
     
    TwistMyArm, May 10, 2007 IP
  6. Michael C. Marshall

    Michael C. Marshall Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Zip:

    // add content of the local directory C:\Data\
    // to the directory \Data-2010 (within the ZIP archive)
    // (ZIP archive C:\archive.zip doesn't have to exist)
    ZipArchive.Add(@"C:\archive.zip", @"C:\Data\*", @"\Data-2010");

    Unzip:
    // extract whole content of the ZIP archive to the existing local directory C:\Data
    ZipArchive.ExtractAll(@"C:\archive.zip", @"C:\Data");

    All using Rebex ZIP from www(dot)rebex(dot)net(slash)zip.net
     
    Michael C. Marshall, Aug 4, 2010 IP