System.IO.Packaging 命名空间

提供支持在单个容器中存储多个数据对象的类。 Provides classes that support storage of multiple data objects in a single container.


表示包含加密包的 OLE 复合文件。Represents an OLE compound file that contains an encrypted package.


表示一个可以存储多个数据对象的容器。Represents a container that can store multiple data objects.


表示应用于一组包部件和关系的数字签名。Represents a digital signature that is applied to a set of package parts and relationships.


提供一个实用工具类,用来在 Package 中创建和验证数字签名。Provides a utility class for the creation and verification of digital signatures in a Package.


为存储在 Package 中的部分提供基类。Provides a base class for parts stored in a Package. 此类为抽象类。This class is abstract.


表示 PackagePart 对象集合。Represents a collection of PackagePart objects.


表示 Package 的核心属性。Represents the core properties of a Package.


表示源 PackagePackagePart 与可以为 PackagePart 或外部资源的目标对象之间的关联。Represents an association between a source Package or PackagePart, and a target object which can be a PackagePart or external resource.


表示为给定的 PackageRelationshipPackagePart 所拥有的 Package 元素的集合。Represents a collection of PackageRelationship elements that are owned by a given PackagePart or the Package.


定义 PackageRelationship 条件来选择部分级或包级关系。Defines PackageRelationship criteria to select part-level or package-level relationships.


表示结合 Package 使用的应用程序特定的 PackWebRequest 实例的集合。Represents a collection of application-specific Package instances used in combination with PackWebRequest.


提供实用工具方法来撰写和分析 pack URI 对象。Provides utility methods to compose and parse pack URI objects.


向整个 PackagePart 或包中的 PackagePart 发出请求,由 Pack URI 标识。Makes a request to an entire PackagePart or to a PackagePart in a package, identified by a pack URI.


表示创建包 URI PackWebRequest 实例时调用的类。Represents the class that is invoked when an instance of a pack URI PackWebRequest is created.


表示 PackWebRequest 的响应。Represents a response of a PackWebRequest.


表示存储在 EncryptedPackageEnvelope 中的数字版权管理 (DRM) 信息。Represents Digital Rights Management (DRM) information that is stored in an EncryptedPackageEnvelope.


指定提供给 InvalidSignatureEventHandler 的事件参数。Specifies the event args provided to the InvalidSignatureEventHandler.


提供访问和信息,用以操作 Package 中的数据存储区。Provides access and information for manipulating data stores in a Package.


提供用于操作 Package 中的 I/O 流的访问和信息。Provides access and information for manipulating I/O streams within a Package.


实现抽象 Package 基类的派生子类 - ZipPackage 类将 ZIP 存档用作容器存储。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.


表示存储在 ZipPackage 中的部分。Represents a part that is stored in a ZipPackage.



指定一个位置,其中存储了签名时所用的 X.509 证书。Specifies the location where the X.509 certificate that is used in signing is stored.


PackagePart 中存储的内容指定压缩级别。Specifies the compression level for content that is stored in a PackagePart.


Package 中的部分指定加密选项。Specifies the encryption option for parts in a Package.


指定用于通过 PackageRelationship 匹配并返回 PackageRelationshipSelector 选择的选择条件的类型。Specifies the type of selection criteria that is used to match and return PackageRelationship selections through a PackageRelationshipSelector.


指定 PackageRelationship 的目标是在 Package 的内部还是外部。Specifies whether the target of a PackageRelationship is inside or outside the Package.


指定证书或签名验证的结果。Specifies the result of a certificate or signature verification.



表示处理当 InvalidSignatureEvent 检测到无效的签名时所引发的 VerifySignatures(Boolean) 的方法。Represents the method that handles the InvalidSignatureEvent that is raised when VerifySignatures(Boolean) detects an invalid signature.


Package是一个抽象类, 可用于将对象组织成定义的物理格式的单个实体, 以实现可移植性和高效访问。Package is an abstract class that can be used to organize objects into a single entity of a defined physical format for portability and efficient access.

ZIP 文件是的主要物理格式PackageA ZIP file is the primary physical format for the Package. 其他Package实现可能使用其他物理格式, 如 XML 文档、数据库或 Web 服务。Other Package implementations might use other physical formats such as an XML document, a database, or Web service.

与文件系统类似, 中包含的Package项将在文件夹和文件的层次结构中引用。Like a file system, items contained in a Package are referenced in a hierarchical organization of folders and files.

尽管Package是抽象类ZipPackage , 但Package.Open方法使用派生类作为默认值。Although Package is an abstract class, the ZipPackage derived class is used as default by the Package.Open method.

("Part") 是表示存储Package在中的对象的抽象类。 PackagePartA PackagePart ("part") is the abstract class that represents an object that is stored in a Package.

("关系") 定义源Package对象或PackagePart目标对象之间的关联。 PackageRelationshipA PackageRelationship ("relationship") defines an association between a source Package or PackagePart and a target object. PackageRelationship可以是以下两种类型之一, 其中每种类型可以为以下两种形式之一:A PackageRelationship can be one of two types, each of which can be one of two forms:

关系的源Package或源PackagePart被视为关系的 "所有者"。The relationship's source Package or source PackagePart is considered the "owner" of the relationship. 删除源对象时, 还将删除源对象所拥有的所有关系。When the source object is deleted, all the relationships owned by the source object are also deleted. 创建或删除关系的过程不会以任何方式以物理方式更改源对象或目标对象。The process of creating or deleting a relationship does not physically change either the source or target objects in any way.

("数字签名") 是部件和关系的组合, 表示包含在Package中的数字签名。 PackageDigitalSignatureA PackageDigitalSignature ("digital signature") is a composition of parts and relationships representing a digital signature included with a Package. 数字签名标识发信方, 并验证中Package包含的签名部分和关系是否未被修改。The digital signature identifies the originator and validates that the signed parts and relationships contained in the Package have not been modified.

包还支持数字 Rights Management (DRM), 这允许使用向授权用户Package授予的特定访问权限对中的内容元素进行加密。Packages also support Digital Rights Management (DRM), which allows content elements in a Package to be encrypted with specific access rights granted to authorized users.

基于体系结构, 是一种用于基于 open XML 纸张规范 (XPS)存储文档的包类型。 XpsDocument PackageBased on the Package architecture, an XpsDocument is a package type designed for storing documents based on the open XML Paper Specification (XPS).

默认情况下, Windows Presentation Foundation 使用包来存储页面和文档的内容、资源和关系。Windows Presentation Foundation uses packages to store content, resources, and relationships for pages and documents using a standard ZIP file by default. 与任何 ZIP 文件一样, 应用程序可以使用System.IO.Packaging类来存储和选择在单个有效访问权限容器中保护任何类型或数量的数据文件。As with any ZIP file, your application can use the System.IO.Packaging classes to store and optionally protect any type or number of data files in a single efficient-to-access container.

有关详细信息, 请参阅Windows 硬件开发人员中心的 XPS 部分的开放打包约定 (OPC) 规范。For more information, see the Open Packaging Conventions (OPC) specification, available for download at the XPS section of Windows Hardware Developer Central.