在 WinRT Metro App C# 中获取操作系统版本 [英] Get OS-Version in WinRT Metro App C#

查看:24
本文介绍了在 WinRT Metro App C# 中获取操作系统版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 C# 和 Visual Studio 11 Beta 编写 Metro Style 应用程序.现在我想获得操作系统的操作系统版本.我怎样才能得到这个?

I'm programming a Metro Style App with C# and the Visual Studio 11 Beta. Now I want to get the OS-Version of the OS. How can I get this?

我发现了如何在普通"应用程序中做到这一点.在那里,您使用属性 O​​SVersion 的 Environment-Class,但在 .NET Core 中没有此属性

I found out how to do it in "normal" Applications. There you take the Environment-Class with the attribute OSVersion but in .NET Core there isn't this attribute

推荐答案

对于新应用程序,您应该检查特定功能,而不是操作系统版本.

For new applications you should check for specific features, not OS version.

据我所知,没有理由检查操作系统版本,因为 Metro 应用程序仅适用于 win 8.

As far as I can tell there is no reason to check for OS version as metro applications are only available for win 8.

商店应用程序现在可在多个 Windows 版本上使用,但仍建议测试功能而不是操作系统版本.最低操作系统版本在您创建项目时设置为项目的构建目标.

Store applications are available on multiple Windows versions now but it is still recommended to test for features instead of OS versions. Minimum OS version is set as the build target for a project when you create it.

编辑#2:如果您对跟踪应用程序安装基础中的操作系统版本感兴趣,您可以从针对 Windows 8.1 的应用程序开始将 Application Insights 集成到您的项目中.以下是如何开始使用它:

Edit #2: If you are interested in tracking OS versions in your application's install base you can integrate Application Insights into your project starting with applications targeted at Windows 8.1. Here's a howto on getting started with it:

http://azure.microsoft.com/en-us/documentation/articles/app-insights-windows-get-started/

这篇关于在 WinRT Metro App C# 中获取操作系统版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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