Introduction
If you want to zip / unzip files without using third party libraries, and you want a method that can be used easily and works fine, you can use the Windows Shell32. I've written the code in VB 2010 using .NET Framework 2.0, but it's simple and can be easily converted to any other language like C#.
Using the Code
As I mentioned above, I'm going to use Visual Basic 2010 with .NET Framework 2.0.
- Create a new project.
- From the main menu, select Project -> Add Reference.
- Select the COM tab and search for Microsoft Shell Controls and Automation.

How It Works
We will use the CopyHere command. We need to create an empty zip file, then we will use Shell32 to copy the files that we want to compress into the output Zip file. Or use it to unzip the files we have compressed previously to an output folder.
Imports Shell32
Public Class Form1
Sub Zip()
Dim startBuffer() As Byte = {80, 75, 5, 6, 0, 0, 0, 0, 0, 0, 0, _
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
FileIO.FileSystem.WriteAllBytes("d:\empty.zip", startBuffer, False)
Dim sc As New Shell32.Shell()
Dim input As Shell32.Folder = sc.NameSpace("D:\neededFiles")
Dim output As Shell32.Folder = sc.NameSpace("D:\empty.zip")
output.CopyHere(input.Items, 4)
End Sub
Sub UnZip()
Dim sc As New Shell32.Shell()
IO.Directory.CreateDirectory("D:\extractedFiles")
Dim output As Shell32.Folder = sc.NameSpace("D:\extractedFiles")
Dim input As Shell32.Folder = sc.NameSpace("d:\myzip.zip")
output.CopyHere(input.Items, 4)
End Sub
End Class
In the CopyHere command, I have used option = 4. To use other options, please refer to this page:
http://msdn.microsoft.com/en-us/library/windows/desktop/bb787866(v=vs.85).aspx.
I hope I have provided something useful.