Bagikan melalui


PackageVersion Struktur

Definisi

Mewakili info versi paket.

public value class PackageVersion
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
struct PackageVersion
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
public struct PackageVersion
var packageVersion = {
major : /* Your value */,
minor : /* Your value */,
build : /* Your value */,
revision : /* Your value */
}
Public Structure PackageVersion
Warisan
PackageVersion
Atribut

Persyaratan Windows

Rangkaian perangkat
Windows 10 (diperkenalkan dalam 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (diperkenalkan dalam v1.0)

Contoh

Gunakan properti Package.Current untuk mendapatkan paket untuk aplikasi saat ini. Gunakan properti Package.Id untuk mendapatkan ID paket, tempat Anda kemudian bisa mendapatkan versinya.

var package = Windows.ApplicationModel.Package.current;
var packageId = package.id;
var version = packageId.version;
using Windows.ApplicationModel;

Package package = Package.Current;
PackageId packageId = package.Id;
PackageVersion version = packageId.Version;
Dim package As Windows.ApplicationModel.Package = Windows.ApplicationModel.Package.Current
Dim packageId As Windows.ApplicationModel.PackageId = package.Id
Dim version As Windows.ApplicationModel.PackageVersion = packageId.Version
Windows::ApplicationModel::Package package{ Windows::ApplicationModel::Package::Current() };
Windows::ApplicationModel::PackageId packageId{ package.Id() };
Windows::ApplicationModel::PackageVersion version{ packageId.Version() };
Windows::ApplicationModel::Package^ package = Windows::ApplicationModel::Package::Current;
Windows::ApplicationModel::PackageId^ packageId = package->Id;
Windows::ApplicationModel::PackageVersion version = packageId->Version;

Bidang

Build

Nomor versi build paket.

Major

Nomor versi utama paket.

Minor

Nomor versi minor paket.

Revision

Nomor versi revisi paket.

Berlaku untuk

Lihat juga