■ Package 클래스를 사용해 패키지 정보를 구하는 방법을 보여준다.
▶ 예제 코드 (C#)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
using Windows.ApplicationModel; Package package = Package.Current; PackageId packageId = package.Id; PackageVersion packageVersion = packageId.Version; string information = string.Format ( "Name : \"{0}\"\n" + "Version : {1}.{2}.{3}.{4}\n" + "Architecture : {5}\n" + "ResourceId : \"{6}\"\n" + "Publisher : \"{7}\"\n" + "PublisherId : \"{8}\"\n" + "FullName : \"{9}\"\n" + "FamilyName : \"{10}\"\n" + "IsFramework : {11}", packageId.Name, packageVersion.Major, packageVersion.Minor, packageVersion.Build, packageVersion.Revision, packageId.Architecture, packageId.ResourceId, packageId.Publisher, packageId.PublisherId, packageId.FullName, packageId.FamilyName, package.IsFramework ); |