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);
  • 相关阅读:
    Jzoj4782 Math
    Jzoj4778 数列编辑器
    Jzoj4778 数列编辑器
    力扣算法题—067二进制求和
    力扣算法题—066加一
    最小凸包算法
    力扣算法题—065有效数字
    力扣算法题—064最小路径之和
    力扣算法题—063不同路径2
    力扣算法题—062不同路径
  • 原文地址:https://www.cnblogs.com/hebeiDGL/p/2684726.html
Copyright © 2011-2022 走看看