?
Solved

need a VB6 zipping component adn a compatible .net one

Posted on 2006-05-31
8
Medium Priority
?
248 Views
Last Modified: 2010-04-30
I have a vb6 client that needs a SMALL dll to use to zip some files (i just want minimal zip functionality) - but I also need a compatible .net component to run on the server side to decompress the files compressed on the client.

does anyone know any?  Xceed have good libraries - but their client side zip ActiveX is 500 KB - which is way too big
0
Comment
Question by:kenshaw
8 Comments
 
LVL 14

Expert Comment

by:Matti
ID: 16798805
Hi!

If the need is unzip only then:
ftp://ftp.info-zip.org/pub/infozip/WIN32/unz552dN.zip

There is VB sample code how to use this dll.


Matti
0
 
LVL 4

Author Comment

by:kenshaw
ID: 16798948
no - i need to zip and unzip
0
 
LVL 20

Accepted Solution

by:
hes earned 2000 total points
ID: 16799553
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 4

Author Comment

by:kenshaw
ID: 16799665
but thats only for VB6 - then i need somethign for .net on the server side

aren't there issues with getting different zip libraries to interoperate?  thats why i thought it was a good idea to get two components from one vendor...
0
 
LVL 2

Expert Comment

by:ExtremeFitness
ID: 16799923
what if you call zip via the shell command...
0
 
LVL 6

Expert Comment

by:junglerover77
ID: 16803809
Hi Kenshaw,

I don't understand why you say hes's dlls are only for VB6. They are just some WIN32 DLLs, and it's obvious that you can use them with VB.net as well.
0
 
LVL 4

Author Comment

by:kenshaw
ID: 16804674
hmm... but its not managed code - and its not going to scale well on a webserver - which is why i want a .net native component for the server side.

i can hack it up using those dll's sure... but its not going to scale well or safely
0
 
LVL 28

Expert Comment

by:Ark
ID: 16805333
'For XP+ OS
'sSource - can be file or folder
'sDest - zip file path

Public Function vbZIP(ByVal sSource As String, ByVal sDest As String) As Boolean
   Dim lAttr As Long, lInitialLength As Long
   lAttr = GetFileAttributes(sSource)
   If lAttr = -1 Then Exit Function
   
   Dim sZipHeader As String
'   sZipHeader = Chr(80) & Chr(75) & Chr(5) & Chr(6) & String(18, Chr(0))
   sZipHeader = "PK" & Chr(5) & Chr(6) & String(18, Chr(0))
   If Dir(sDest) <> "" Then Kill sDest
   Dim nFile As Integer
   nFile = FreeFile
   Open sDest For Output As #nFile
      Print #nFile, sZipHeader
   Close #nFile
   lInitialLength = FileLen(sDest)
   Dim oShell, oSource
   Set oShell = CreateObject("Shell.Application")
  'Copy the file(s) to the compressed folder
   If (lAttr And vbDirectory) = vbDirectory Then
      Set oSource = oShell.NameSpace(CVar(sSource)).Items
   Else
      Set oSource = oShell.NameSpace(CVar(GetParentFolder(sSource))).ParseName(GetFileTitle(sSource))
   End If
   If Not oSource Is Nothing Then
      oShell.NameSpace(CVar(sDest)).CopyHere oSource, &H615
   Else
      GoTo ErrZip
   End If
   Do While Dir(sDest) = ""
      DoEvents
      Sleep 100
   Loop
   On Error Resume Next
   Do While FileLen(sDest) = lInitialLength
      DoEvents
      Sleep 100
   Loop
  'wait for lock to release
   On Error Resume Next
   Do
'Attempt to open the file, this causes an Err 70,
'Permission Denied when the file is already open
      nFile = FreeFile
      Open sDest For Append As #nFile
      Close #nFile
      If Err = 0 Then Exit Do
      Sleep 100
      Err.Clear
   Loop
   vbZIP = True
ErrZip:
   Set oSource = Nothing
   Set oShell = Nothing
End Function

0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month17 days, 12 hours left to enroll

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question