2019年11月7日 星期四

test3

Private Sub SurroundingSub()
    Dim zip As Chilkat.Zip = New Chilkat.Zip()
    zip.UnlockComponent("Anything for 30-day trial")
    Dim zipFilename As String = "myZip.zip"
    Dim isPwdProtected As Boolean = zip.IsPasswordProtected(zipFilename)
    If isPwdProtected Then
        MessageBox.Show("This zip is password-protected and requires a password to open.")
        Return
    End If
    Dim success As Boolean = zip.OpenZip(zipFilename)
    If Not success Then
        MessageBox.Show(zip.LastErrorText)
        Return
    End If
    Dim entry As Chilkat.ZipEntry = zip.GetEntryByIndex(0)
    If entry.CompressionMethod = 99 Then
        MessageBox.Show("This zip is WinZip AES strong encrypted!")
        Return
    End If
    Dim i As Integer
    Dim n As Integer = zip.NumEntries
    For i = 0 To n - 1
        entry = zip.GetEntryByIndex(i)
        If entry.CompressionMethod = 99 Then
            MessageBox.Show("This zip is WinZip AES strong encrypted!")
            Return
        End If
    Next
    MessageBox.Show("We got here, so the Zip is not encrypted!")
End Sub

沒有留言:

張貼留言