Scan Method

Scans the compressed archive.

Syntax

public void Scan();
Public Sub Scan()

Remarks

This method will scan the archive specified by ArchiveFile. The number of files and their names and sizes will be determined and written to the Files collection.

After scanning the archive, the values of DecompressedName may be changed if desired, and any number of files may be decompressed. The Extract method allows you to decompress files of your choice, and the ExtractAll method will decompress the entire archive.

Changing the values of the CompressedName field or the number of files in the Files collection will invalidate the scan. If either of these is changed and Extract or ExtractAll is then called; Scan will automatically be called again, and these values will be reset to their original values.

Calling this method will frequently generate a trappable error if the archive is corrupt. This is not guaranteed, however, as Scan only examines the headers.

Example


Dim i as Integer
ZipControl.ArchiveFile = "c:\temp.zip"
ZipControl.Scan()
For i = 0 to ZipControl.Files(i).Count -1
  Debug.Write("File name : ")
  Debug.Write(ZipControl.Files(i).DecompressedName)
  Debug.Write(" Size: ")
  Debug.WriteLine(ZipControl.Files(i).DecompressedSize)
Next i

.NET Standard Notes

To call this method in an asynchronous manner call ScanAsync instead. When the method completes (or an error is encountered) the ScanCompleted event will fire.

 
 
Copyright (c) 2021 /n software inc. - All rights reserved.
IPWorks ZIP 2020 .NET Edition - Version 20.0 [Build 7720]