VB.NET
VB.NET
Transition from ZipEntry.NextEntry to ZipEntry.GetNext
Provides instructions for replacing deprecated NextEntry method calls with GetNext.Chilkat VB.NET Downloads
Dim success As Boolean = False
' ------------------------------------------------------------------------
' The NextEntry method is deprecated.
' See below or code showing how to rewrite using EntryAt/GetNext
Dim zip As New Chilkat.Zip
success = zip.OpenZip("qa_data/zips/xml_files.zip")
If (success <> True) Then
Debug.WriteLine(zip.LastErrorText)
Exit Sub
End If
Dim entry As Chilkat.ZipEntry = zip.FirstEntry()
If (zip.LastMethodSuccess = False) Then
Debug.WriteLine("This zip archive is empty.")
Exit Sub
End If
Dim finished As Boolean = False
While finished = False
If (entry.IsDirectory = False) Then
Debug.WriteLine(entry.FileName)
Else
Debug.WriteLine("(directory) " & entry.FileName)
End If
Dim next As Chilkat.ZipEntry = entry.NextEntry()
If (entry.LastMethodSuccess = False) Then
finished = True
End If
entry = next
End While
zip.CloseZip()
Debug.WriteLine("----")
' ------------------------------------------------------------------------
' Do the equivalent using EntryAt/GetNext.
success = zip.OpenZip("qa_data/zips/xml_files.zip")
Dim ze As New Chilkat.ZipEntry
zip.EntryAt(0,ze)
Dim entryValid As Boolean = True
While entryValid = True
If (ze.IsDirectory = False) Then
Debug.WriteLine(ze.FileName)
Else
Debug.WriteLine("(directory) " & ze.FileName)
End If
entryValid = ze.GetNext()
End While
zip.CloseZip()