ICSharpCode.SharpZipLib.Zip.ZipFile.GetEntry C# (CSharp) Method

GetEntry() public method

Searches for a zip entry in this archive with the given name. String comparisons are case insensitive
/// The Zip file has been closed. ///
public GetEntry ( string name ) : ZipEntry
name string /// The name to find. May contain directory components separated by slashes ('/'). ///
return ZipEntry
        public ZipEntry GetEntry(string name) {
            if (isDisposed_) {
                throw new ObjectDisposedException("ZipFile");
            }

            int index=FindEntry(name, true);
            return (index>=0)?(ZipEntry)entries_[index].Clone():null;
        }

Usage Example

Esempio n. 1
0
 public Stream GetContent(string filename)
 {
     using (var z = pkg.GetInputStream(pkg.GetEntry(filename)))
     {
         var ms = new MemoryStream();
         z.CopyTo(ms);
         ms.Seek(0, SeekOrigin.Begin);
         return(ms);
     }
 }
All Usage Examples Of ICSharpCode.SharpZipLib.Zip.ZipFile::GetEntry