Author Topic: Replacing Ionic.zip.dll with Chilkat.zip  (Read 251 times)

XardozCom

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Replacing Ionic.zip.dll with Chilkat.zip
« on: June 13, 2018, 11:54:48 PM »


All seems to be going well as Chilkat is straightforward

We get a Zip with a file with the needed data, but no password required!

Please help...

    Public Function ReturnDecodedKeys(ByVal sFeatureNumber As String, _
                                      ByVal sAppDataPath As String, _
                                      Optional ByVal bZip As Boolean = False) As String

        If bZip Then
            Dim zip As New Chilkat.Zip
            Dim success As Boolean = zip.UnlockComponent("z")
            Dim resultZip As String = ""
            If (success <> True) Then
                resultZip = zip.LastErrorText
                AppendToFile("Chilkat Logon Failed: " & resultZip)
                Return resultZip
                Exit Function
            End If

            zip.SetPassword("1234")
            zip.PasswordProtect = True
            Dim saveExtraPath As Boolean
            saveExtraPath = False
            success = False
            success = zip.AppendOneFileOrDir(sAppDataPath & "\Feature" & sFeatureNumber & ".zip", saveExtraPath)
            'success = zip.NewZip(sAppDataPath & "\Feature" & sFeatureNumber & ".zip")
            If (success <> True) Then
                resultZip = zip.LastErrorText
                AppendToFile("Chilkat Zip Creation Failed: " & resultZip)
                Return resultZip
                Exit Function
            End If

            Dim fac As New Chilkat.FileAccess
            zip.AppendString("results.dat", sSystemKey.ToString & vbNewLine & s.ToString)
            success = False

            success = zip.WriteZipAndClose()
            If (success <> True) Then
                resultZip = zip.LastErrorText
                AppendToFile("Feature.zip Failed: " & resultZip)
                Return resultZip
                Exit Function
            End If

        End If

        ReturnDecodedKeys = s 'sSystemKey & "|" & s
    End Function

« Last Edit: June 14, 2018, 07:36:02 AM by Chilkat »

Chilkat

  • Administrator
  • Full Member
  • *****
  • Posts: 103
  • Karma: +6/-0
    • View Profile
Re: Replacing Ionic.zip.dll with Chilkat.zip
« Reply #1 on: June 14, 2018, 07:37:57 AM »
The sequence of calls should be like this:

Code: [Select]
Dim zip As New Chilkat.Zip
success = zip.NewZip(sAppDataPath & "\Feature" & sFeatureNumber & ".zip")
zip.SetPassword("1234")
zip.PasswordProtect = True
zip.AppendString("results.dat", sSystemKey.ToString & vbNewLine & s.ToString)
success = zip.WriteZipAndClose()

XardozCom

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Replacing Ionic.zip.dll with Chilkat.zip
« Reply #2 on: June 14, 2018, 10:38:48 AM »
Thank You