|
-
Jun 5th, 2000, 05:49 PM
#1
Dear Friends,
I wanted to write a code in my VB application such that, It can read Zip file and can extract files/folders inside it to selected folder...I think I can do this using some APIs or some OCX control if available... But I dont know where to find it....so could you please help me out.
This all process must be through VB code...no client intraction is required at run time.
-
Jun 5th, 2000, 09:33 PM
#2
Fanatic Member
If you remember the good old days of pk(un)Zip, then you will know that that is easy.
Syntax was something like.
Code:
pkzip *.* c:\myZip.Zip
pkUnzip myZip.Zip c:\myFolder
This is a relativley easy way to go as you can shell it from yuor VB rpogram. If you don't have pkZip i can mail you a copy.
Iain, thats with an i by the way!
-
Jun 5th, 2000, 11:30 PM
#3
New Member
Hello guy,
Use o xceedzip component, http://www.xceedsoft.com, it comes with a very good help file, that explains it all, try it, it will solve every problem concerning zipping and unzipping files through VB.
Good luck.
-
Jun 5th, 2000, 11:35 PM
#4
PowerPoster
Just use Shell Command
May be you can download the pkzip.exe and pkunzip.exe and just use Shell command to run it.
If you does wish to see the MSDos promt window, you can use the vbHide at your Shell command.
Assume both the pkzip.exe and pkunzip.exe is under your application file path.
Code:
Shell App.Path & "\pkunzip.exe /bla..bla....bla...", vbHide
or
Shell App.Path & "\pkzip.exe /bla..bla....bla...", vbHide
-
Jun 5th, 2000, 11:46 PM
#5
Fanatic Member
Here is an exmaple of very basic usage.
Code:
Private Sub Command1_Click()
'zip up the files
zipFiles "c:\myfolder\*.*", "c:\mynewfolder\myzip.zip"
End Sub
Private Sub Command2_Click()
'unzip the files
unzipFiles "c:\mynewfolder\myzip.zip", "c:\myFolder"
End Sub
Private Sub zipFiles(stFiles As String, stDestinationFile As String)
Dim stCommand As String
'build the command to use
stCommand = "c:\pkzip\pkzip.exe " & stDestinationFile & " " & stFiles
Shell (stCommand)
End Sub
Private Sub unzipFiles(stZipFile As String, stDestination As String)
Dim stCommand As String
'build the command to use
stCommand = "c:\pkzip\pkunzip.exe " & stZipFile & " " & stDestination
Shell (stCommand)
End Sub
Iain, thats with an i by the way!
-
Jun 6th, 2000, 03:51 AM
#6
You can also download some OCX controls called AddZIP Compression Libraries.
-
Jun 6th, 2000, 11:20 AM
#7
Dear Friends...
thank you very much for your very good responce....
I found the best way is to use some dll.. Which I got from one of your mail.. I think that will work for me...
To use shell command may reduce the performance and/or gives less flexibility.....so It is not that much better thought... but still we can use it...
I got mail from Anders Norén who sends me that dll...which you can get from...
http://www.cdrom.com/pub/infozip/doc/WHERE
this is cool dll....
All the Best and Bye...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|