导出 (0) 打印
全部展开
信息
您所需的主题如下所示。但此主题未包含在此库中。

PackageId Class

提供包标识信息,如名称、版本和发行者。

语法


public ref class PackageId sealed 

特性

[DualApiPartition()]
[MarshalingBehavior(Agile)]
[Version(0x06020000)]

成员

PackageId类 具有这些类型的成员:

方法

The PackageId 类 继承这些方法于:Object 类 (C#/VB/C++).

属性

PackageId类 具有这些属性。

属性访问类型说明

Architecture

只读Gets the processor architecture for which the package was created.

Author

只读Windows Phone only. Gets the value of the Author attribute for the specified application package.

FamilyName

只读Gets the family name of the package.

FullName

只读Gets the full name of the package.

Name

只读Gets the name of the package.

ProductId

只读Windows Phone only. Gets the value of the ProductID attribute associated with this application package.

Publisher

只读Gets the publisher of the package.

PublisherId

只读Gets the publisher ID of the package.

ResourceId

只读Gets the resource ID of the package.

Version

只读Gets the package version info.

 

示例

使用 Package.Current | current 属性可以获取当前应用程序包。使用 Package.Id | id 属性可以获取包 ID。此示例通过使用 PackagePackageId 类的成员获取包标识信息。


Windows::ApplicationModel::Package^ package = Windows::ApplicationModel::Package::Current;
Windows::ApplicationModel::PackageId^ packageId = package->Id;
Windows::ApplicationModel::PackageVersion version = packageId->Version;

Platform::String^ output = "Name: \"" + packageId->Name + "\"\n" +
                        "Version: " + VersionString(version) + "\n" +
                   "Architecture: " + ArchitectureString(packageId->Architecture) + "\n" +
                     "ResourceId: \"" + packageId->ResourceId + "\"\n" +
                      "Publisher: \"" + packageId->Publisher + "\"\n" +
                    "PublisherId: \"" + packageId->PublisherId + "\"\n" +
                       "FullName: \"" + packageId->FullName + "\"\n" +
                     "FamilyName: \"" + packageId->FamilyName + "\"\n" +
                    "IsFramework: " + package->IsFramework.ToString();

要求

最低支持客户端

Windows 8 [Windows 应用商店应用程序, 桌面应用程序]

最低支持服务器

Windows Server 2012 [Windows 应用商店应用程序, 桌面应用程序]

最低支持电话

Windows Phone 8

命名空间

Windows.ApplicationModel
Windows::ApplicationModel [C++]

元数据

Windows.winmd

另请参见

示例
应用程序包信息示例
概念
应用程序包和部署
引用
Package.Current
Package.Id

 

 

显示:
© 2015 Microsoft