Zip extracter

Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
11 posts Page 1 of 2
Contributors
User avatar
Livengood
Serious Programmer
Serious Programmer
Posts: 445
Joined: Tue Feb 16, 2010 6:24 am

Zip extracter
Livengood
Hey guys i was woundering if anyone could make a tutorial on how to extract a files from a zip to a folder that you choose
if would be very useful :D
Last edited by Livengood on Sat Feb 20, 2010 11:54 pm, edited 1 time in total.
Image
User avatar
hungryhounduk
VIP - Site Partner
VIP - Site Partner
Posts: 2870
Joined: Mon Jul 27, 2009 11:58 am

Re: Zip extracter
hungryhounduk
Hey guys i was woundering if anyone could make a tutorial on how to extract a files from a zip to a folder that you choose if would be very useful
Hi Livengood
Someone a while back posted the same queastion, have a look here in this section as i'm sure there is a post answering that......hope this helps

regards

Chris

ps: welcome to codenstuff cooll;
Image
User avatar
Livengood
Serious Programmer
Serious Programmer
Posts: 445
Joined: Tue Feb 16, 2010 6:24 am

Re: Zip extracter
Livengood
Thanks :)
Image
User avatar
Livengood
Serious Programmer
Serious Programmer
Posts: 445
Joined: Tue Feb 16, 2010 6:24 am

Re: Zip extracter
Livengood
i found it,
http://dotnetzip.codeplex.com/
but i keep getting an error :(
Image
User avatar
hungryhounduk
VIP - Site Partner
VIP - Site Partner
Posts: 2870
Joined: Mon Jul 27, 2009 11:58 am

Re: Zip extracter
hungryhounduk
Hi Livengood
mm i have not tried that out myself, so i dont know what the error is, but i'm sure someone will come here and point you in the right direction and help you with the problem.

Chris
Image
User avatar
Livengood
Serious Programmer
Serious Programmer
Posts: 445
Joined: Tue Feb 16, 2010 6:24 am

Re: Zip extracter
Livengood
I get a error with the line that has ZipFile in it
Image
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4392
Joined: Tue Aug 04, 2009 1:47 am

Re: Zip extracter
CodenStuff
Hello,

Are you using this code:
Code: Select all
Dim ZipToUnpack As String = "C:\C1P3SML.zip"  'Name and location of your zip file
   Dim TargetDir As String = "C:\C1P3SML"  'Location and folder name to extract too
   Using zip1 As ZipFile = ZipFile.Read(ZipToUnpack)   
        Dim e As ZipEntry   
       ' here, we extract every entry, but we could extract    
       ' based on entry name, size, date, etc.   
       For Each e In zip1   
           e.Extract(TargetDir, ExtractExistingFileAction.OverwriteSilently)   
       Next  
   End Using  
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
User avatar
Livengood
Serious Programmer
Serious Programmer
Posts: 445
Joined: Tue Feb 16, 2010 6:24 am

Re: Zip extracter
Livengood
yea i was trying to use that code, i keep getting a error

Code + Error spot :
Dim ZipToUnpack As String = "C:\C1P3SML.zip" 'Name and location of your zip file
Dim TargetDir As String = "C:\C1P3SML" 'Location and folder name to extract too
Using zip1 As ZipFile = ZipFile.Read(ZipToUnpack)
Dim e As ZipEntry
' here, we extract every entry, but we could extract
' based on entry name, size, date, etc.
For Each e In zip1
e.Extract(TargetDir, ExtractExistingFileAction.OverwriteSilently)
Next
End Using
Image
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4392
Joined: Tue Aug 04, 2009 1:47 am

Re: Zip extracter
CodenStuff
Hello,

When you download the DotNetZip library make sure you reference the "Ionic.Zip.dll" file by:

Clicking "Project" in the top menu and then click "Your application properties" > "References" then browser to the dll and click OK.

Then add this import to the top of your forms code:
Code: Select all
Imports Ionic.Zip
And use this for extracting zips:
Code: Select all
  Dim ZipToUnpack As String = "C:\C1P3SML.zip"  'Name and location of your zip file
        Dim TargetDir As String = "C:\C1P3SML"  'Location and folder name to extract too
        Using zip1 As ZipFile = ZipFile.Read(ZipToUnpack)
            Dim we As ZipEntry
            For Each we In zip1
                we.Extract(TargetDir, ExtractExistingFileAction.OverwriteSilently)
            Next
        End Using
Happy coding cooll;
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
User avatar
Livengood
Serious Programmer
Serious Programmer
Posts: 445
Joined: Tue Feb 16, 2010 6:24 am

Re: Zip extracter
Livengood
Thank you :D
it worked
Image
11 posts Page 1 of 2
Return to “Tutorial Requests”