2
« 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