C# | Visual Basic | Visual C++ |
public ICollection<ZipEntry> SelectEntries( string selectionCriteria )
Public Function SelectEntries ( _ selectionCriteria As String _ ) As ICollection(Of ZipEntry)
public: ICollection<ZipEntry^>^ SelectEntries( String^ selectionCriteria )
- selectionCriteria (String)
- the string that specifies which entries to select
This method allows callers to retrieve the collection of entries from the zipfile that fit the specified criteria. The criteria are described in a string format, and can include patterns for the filename; constraints on the size of the entry; constraints on the last modified, created, or last accessed time for the file described by the entry; or the attributes of the entry.
For details on the syntax for the selectionCriteria parameter, see AddSelectedFiles(String).
This method is intended for use with a ZipFile that has been read from storage. When creating a new ZipFile, this method will work only after the ZipArchive has been Saved to the disk (the ZipFile class subsequently and implicitly reads the Zip archive from storage.) Calling SelectEntries on a ZipFile that has not yet been saved will deliver undefined results.
using (ZipFile zip1 = ZipFile.Read(ZipFileName)) { var PhotoShopFiles = zip1.SelectEntries("*.psd"); foreach (ZipEntry psd in PhotoShopFiles) { psd.Extract(); } }
Using zip1 As ZipFile = ZipFile.Read(ZipFileName) Dim PhotoShopFiles as ICollection(Of ZipEntry) PhotoShopFiles = zip1.SelectEntries("*.psd") Dim psd As ZipEntry For Each psd In PhotoShopFiles psd.Extract Next End Using
Exception | Condition |
---|---|
Exception |
Thrown if selectionCriteria has an invalid syntax.
|