Package.GetRelationship(String) 方法
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
返回具有给定标识符的包级别关系。
public:
System::IO::Packaging::PackageRelationship ^ GetRelationship(System::String ^ id);
C#
public System.IO.Packaging.PackageRelationship GetRelationship(string id);
member this.GetRelationship : string -> System.IO.Packaging.PackageRelationship
Public Function GetRelationship (id As String) As PackageRelationship
具有指定 id
的包级别关系。
id
为 null
。
id
不是有效的 XML 标识符。
包中不存在具有指定 id
的关系。
包未打开(已调用了 Dispose(Boolean) 或 Close())。
包是只写的。
id
必须是有效的 XML 标识符。 类型 id
为 xsd:ID,必须遵循 XML 架构第 2 部分:数据类型规范的第 3.3.8 部分规定的命名约定。
有关打包和包关系的其他信息,请参阅开放打包约定 (OPC) 规范的第 1.3 部分,可在 下载 https://www.ecma-international.org/publications-and-standards/standards/ecma-376/。
产品 | 版本 |
---|---|
.NET | Core 1.0, Core 1.1, 8 (package-provided), 9 (package-provided), 10 (package-provided) |
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided) |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |