Help with ComponentOne Zip

  • Thread starter Thread starter Dave Harris
  • Start date Start date
D

Dave Harris

I am trying to convert QuickBasic and dos batch files into VB.NET. I
downloaded the resource kit along with the free ComponentOne Zip classes.
The examples that came with the zip utility were not real helpful as I am
relatively new to VB.NET. I need to unzip a file composed of about 20 text
files. Once the file is unzipped, I have a form which allows the user to
edit one of the unzipped text files. I then save the edited version and now
need to zip that individual text file back into the zip file. I know how to
edit the text file but the zipping and unzipping routines are giving me
fits. How do I do this? Thanks in advance for your help.

Dave Harris
 
Hi Dave,

Not hard at all.

First, you have to use an imports statement at the top of your form, as
follows:
Imports System.IO

Imports C1.C1Zip

Then, to zip and subsequently to extract (q & d and you have to make sure
the filenames don't already exist):

Dim mzip As C1ZipFile

mzip = New C1ZipFile

mzip.Create("f:\imcapps\pslips_.zip")

mzip.Entries.Add("f:\imcapps\dbffiles\natlbl.dbf")

mzip.Entries.Add("f:\imcapps\dbffiles\summary.dbf")

mzip.Close()

MessageBox.Show("now I will move the extracts of f:\imcapps\pslips_.zip into
f:\imcapps")

mzip.Open("f:\imcapps\pslips_.zip")

Dim i, x As Integer

x = mzip.Entries.Count - 1

For i = 0 To x

mzip.Entries.Extract(i)

Next

As a point of information, you can probably get the .chm help file for
componentone.com; also, there is an n/g at componentone.public.net.c1zip
that can offer some help.

HTH,

Bernie Yaeger
 
Back
Top