Retrieve the Current App version from Package

混江龙づ霸主 提交于 2019-11-29 00:58:46
Kevin Avignon

Here's what you can do to retrieve the version in code:

using Windows.ApplicationModel;

public static string GetAppVersion()
{
  Package package = Package.Current;
  PackageId packageId = package.Id;
  PackageVersion version = packageId.Version;

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

Reference: http://www.michielpost.nl/PostDetail_67.aspx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!