zoukankan      html  css  js  c++  java
  • 02、获取 win 8 程序包信息

    命名空间:   Windows.ApplicationModel

    1、获取应用程序安装文件夹的路径:

      // This will give the Installed Location.  You can use this location to access files, if you need them.
                Windows.Storage.StorageFolder installedLocation = Package.Current.InstalledLocation;
    txt.Text = String.Format("Installed Location: {0}", installedLocation.Path);

    2、获取包版本信息:

     String versionString(PackageVersion version)
            {
                return String.Format("{0}.{1}.{2}.{3}",
                                     version.Major, version.Minor, version.Build, version.Revision);
            }

    3、获取应用程序所支持的处理器体系结构:

     String architectureString(Windows.System.ProcessorArchitecture architecture)
            {
                switch (architecture)
                {
                    case Windows.System.ProcessorArchitecture.X86:
                        return "x86";
                    case Windows.System.ProcessorArchitecture.Arm:
                        return "arm";
                    case Windows.System.ProcessorArchitecture.X64:
                        return "x64";
                    case Windows.System.ProcessorArchitecture.Neutral:
                        return "neutral";
                    case Windows.System.ProcessorArchitecture.Unknown:
                        return "unknown";
                    default:
                        return "???";
                }
            }

    4、应用程序包信息:

    // 调用 2、 3、 中的方法:

                Package package = Package.Current;
                PackageId packageId = package.Id;
    
                OutputTextBlock.Text = String.Format("Name: \"{0}\"\n" +
                                                     "Version: {1}\n" +
                                                     "Architecture: {2}\n" +
                                                     "ResourceId: \"{3}\"\n" +
                                                     "Publisher: \"{4}\"\n" +
                                                     "PublisherId: \"{5}\"\n" +
                                                     "FullName: \"{6}\"\n" +
                                                     "FamilyName: \"{7}\"\n" +
                                                     "IsFramework: {8}",
                                                     packageId.Name,
                                                     versionString(packageId.Version),
                                                     architectureString(packageId.Architecture),
                                                     packageId.ResourceId,
                                                     packageId.Publisher,
                                                     packageId.PublisherId,
                                                     packageId.FullName,
                                                     packageId.FamilyName,
                                                     package.IsFramework);
  • 相关阅读:
    Linux 模块管理
    python 调试方法
    LFS(Linux From Scratch)学习
    Vim完全教程
    OpenSSL基础知识
    关于jiffies回绕以及time_after,time_before
    十分简便的APK反编译(Mac 版本号 具体解释)
    亚马逊是怎样颠覆商业软件高昂价格这座”柏林墙”的
    Android自己定义控件
    Android基础新手教程——4.1.1 Activity初学乍练
  • 原文地址:https://www.cnblogs.com/hebeiDGL/p/2684726.html
Copyright © 2011-2022 走看看