如何在Windows通用的应用程序获得的版本? [英] How to get app version in Windows Universal App?

查看:115
本文介绍了如何在Windows通用的应用程序获得的版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道如何在Windows通用应用程序获取应用程序的版本?

Does anyone know how to get the application version in a Windows Universal app?

曾经有一种阅读的Windows Phone Silverlight应用程序的XAP XAML信息,但因为这改变了我似乎无法找到这样的一条新途径。

There used to be a way reading the xap xaml information in Windows Phone Silverlight apps, but as this changed I can't seem to find a new way of doing this.

推荐答案

您可以阅读的版本从 Package.Id 的。在那里,你会发现:主要构建的和的修改的您的应用程序的数字:

You can read version from Package.Id. There you will find: Major, Minor, Build and Revision numbers of your app:

string appVersion = string.Format("Version: {0}.{1}.{2}.{3}",                          
                    Package.Current.Id.Version.Major, 
                    Package.Current.Id.Version.Minor, 
                    Package.Current.Id.Version.Build,
                    Package.Current.Id.Version.Revision);

这篇关于如何在Windows通用的应用程序获得的版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆