Click here to Skip to main content
11,928,003 members (29,644 online)
Click here to Skip to main content
Add your own
alternative version


47 bookmarked

Zip and Unzip from a C# program using J# runtime

, 25 Apr 2004 CPOL
Rate this:
Please Sign up or sign in to vote.
Zip and Unzip from a C# program using


There are a lot of libraries to work with zip files. I found a very easy way to work with zip files from a C# program. The Microsoft .Net Framework 1.1 comes with new language: J#. Let's look at it a little. For sure, Java is a parent of it; if so, is somewhere here! I spent a few minutes and found it in vjslib.dll. Let's do the work. Start a new C# project and select Windows Application. Our goal is something like that:

All we need to do is: add reference to our project:

Now, we can use it:

// Output stream fos = new; 

// Tie to zip stream zos = new; 

// Stream with source file fis = new; 

// It's our entry in zip ze = new; 

sbyte[] buffer = new sbyte[1024]; 
int len; 

// Read and write until done 
while((len = >= 0) 
    zos.write(buffer, 0, len); 
// Close everything 


That's all! Demo application is included.


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


About the Author

Valeri Makarov
Software Developer
Russian Federation Russian Federation
Over 12 years of experience as a Software Developer/Engineer, development and production support applications for MS DOS, MS Windows.
Certified C Programmer
Certified C++ Programmer
Certified Visual FoxPro Programmer
Certified C# Programmer

You may also be interested in...

Comments and Discussions

QuestionIs it possible to read in the middle of the zip file? Pin
shultas30-Aug-06 16:52
membershultas30-Aug-06 16:52 
AnswerRe: Is it possible to read in the middle of the zip file? Pin
Valeri30-Aug-06 21:21
memberValeri30-Aug-06 21:21 
GeneralRe: Is it possible to read in the middle of the zip file? Pin
shultas31-Aug-06 12:19
membershultas31-Aug-06 12:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.151126.1 | Last Updated 26 Apr 2004
Article Copyright 2004 by Valeri Makarov
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid