Click here to Skip to main content
15,893,668 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi ,

i need to zip a folder in that folder it has bulk of xml files , & also i need too unzip that folder can any one help me too finish off this stuff soon ( can i get code more detail it will be more helpful

& i new too this stuff!

thanks !!

i dont get the solution yet friends it urgent plz try to help me soon !! (vb.net 2008. 2.0 framework )
i need zip a folder and unzip a folder )
Posted
Updated 21-Oct-11 20:11pm
v2

 
Share this answer
 
hi ,


Does it work for vb.net!!



thnks
 
Share this answer
 
The best zip/unzip utility for .NET that i've experienced so far is DotNetZip. It is a third party class library that you can reference in your project.
You can download DotNetZip here:




http://download.codeplex.com/Download?ProjectName=dotnetzip&DownloadId=258012&FileTime=129571576121970000&Build=18207




Extract it to a directory on your pc. You add the DLL (ionic.zip.dll) to your project (you add it as reference) and then you can zip files within a directory, just like this:




'Set filename to save your new zip file

Dim zipFileName As String = "C:\MyZipFile.zip"


'Set the path to directory containing the files you want to zip
Dim fileNames As String() = Directory.GetFiles ("C:\User\Name\Document\FilesToZip\") 

Using zip As Ionic.Zip.ZipFile = New Ionic.Zip.ZipFile 


'Add all the files in that directory to zip
For Each file In fileNames

zip.AddFile(file)

Next 


'save the newly created zip file in the path you specified above
zip.Save (zipFileName) 

End Using 


hope it helps.

Best Regards.
 
Share this answer
 
v3
Use ZIPLIb it is free
"http://www.icsharpcode.net/opensource/sharpziplib/"
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900