Export (0) Print
Expand All

ZipPackage Class

Implements a derived subclass of the abstract Package base class—the ZipPackage class uses a ZIP archive as the container store. This class cannot be inherited.

System::Object
  System.IO.Packaging::Package
    System.IO.Packaging::ZipPackage

Namespace:  System.IO.Packaging
Assembly:  WindowsBase (in WindowsBase.dll)

public ref class ZipPackage sealed : public Package

The ZipPackage type exposes the following members.

  NameDescription
Public propertyFileOpenAccessGets the file access setting for the package. (Inherited from Package.)
Public propertyPackagePropertiesGets the core properties of the package. (Inherited from Package.)
Top

  NameDescription
Public methodCloseSaves and closes the package plus all underlying part streams. (Inherited from Package.)
Public methodCreatePart(Uri, String)Creates a new uncompressed part with a given URI and content type. (Inherited from Package.)
Public methodCreatePart(Uri, String, CompressionOption)Creates a new part with a given URI, content type, and compression option. (Inherited from Package.)
Public methodCreateRelationship(Uri, TargetMode, String)Creates a package-level relationship to a part with a given URI, target mode, and relationship type. (Inherited from Package.)
Public methodCreateRelationship(Uri, TargetMode, String, String)Creates a package-level relationship to a part with a given URI, target mode, relationship type, and identifier (ID). (Inherited from Package.)
Public methodDeletePartDeletes a part with a given URI from the package. (Inherited from Package.)
Public methodDeleteRelationshipDeletes a package-level relationship. (Inherited from Package.)
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodFlushSaves the contents of all parts and relationships that are contained in the package. (Inherited from Package.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetPartReturns the part with a given URI. (Inherited from Package.)
Public methodGetPartsReturns a collection of all the parts in the package. (Inherited from Package.)
Public methodGetRelationshipReturns the package-level relationship with a given identifier. (Inherited from Package.)
Public methodGetRelationshipsReturns a collection of all the package-level relationships. (Inherited from Package.)
Public methodGetRelationshipsByTypeReturns a collection of all the package-level relationships that match a given RelationshipType. (Inherited from Package.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodPartExistsIndicates whether a part with a given URI is in the package. (Inherited from Package.)
Public methodRelationshipExistsIndicates whether a package-level relationship with a given ID is contained in the package. (Inherited from Package.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Explicit interface implemetationPrivate methodIDisposable::DisposeThis member supports the Windows Presentation Foundation (WPF) infrastructure and is not intended for application use. Use the type-safe Dispose method instead. (Inherited from Package.)
Top

The Package.Open method uses ZipPackage containers by default.

This example shows how to create a basic ZipPackage.

The example creates a package that contains a single document part which is defined as the package's root element by a package-level PackageRelationship.

The package also contains an image part and a second PackageRelationship which defines an association between the source document part and the target image part. (The image is a resource that is used with the document).

No code example is currently available or this language may not be supported.

For the complete sample, see Writing a Package Sample.

.NET Framework

Supported in: 4.5.3, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft