[UWP] Windows 10s OS全名/ OS-SKU在UWP中 [英] [UWP]Windows 10s OS Full name/OS-SKU In UWP

查看:132
本文介绍了[UWP] Windows 10s OS全名/ OS-SKU在UWP中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的UWP应用程序中有一个要求,并在Windows 10s上定位此应用程序。


基于OS-NAME,我启用/禁用少数功能。


同样,我需要os-sku值或OS-FullName(例如:Windows xp,windows vista,...... Windows 10s)。



任何人都可以帮助在UWP,Windows 10s中获得此值。

解决方案


嗨RamyaBlr,



通常,UWP应用程序只能安装在Windows 10设备上。 
不建议在UWP应用程序中获取操作系统版本。如果要根据操作系统版本启用/禁用某些功能,可以尝试使用

ApiInformation类
,用于在启动应用程序时检查当前系统中这些API是否可用。



< span style ="font-size:10.5pt; font-family:'Segoe UI',sans-serif;颜色:#454545; border:none windowtext 1.0pt; padding:0in">您可以参考此链接获取更多信息如何使用此API:

https:// docs.microsoft.com/en-us/windows/uwp/debug-test-perf/version-adaptive-code



您可以在此处获得有关创建版本自适应应用的更多信息:



  版本自适应应用程序:
使用新API同时保持与先前版本的兼容性



动态
检测API合约的功能(10 x 10)





最好的问候,



罗伊


I have a requirement in my UWP application and targetting this application on windows 10s.

Based on OS-NAME, I am enabling/Disabling few features.

For the same , I need os-sku value or OS-FullName(Ex : Windows xp,windows vista, ......Windows 10s).

Can anyone please help to get this value in UWP, windows 10s.

解决方案

Hi RamyaBlr,

Generally, UWP apps could only be installed on Windows 10 devices.  It is not recommended to get OS version in UWP apps. If you want to enable/disable some features depend on OS version, you could try to use ApiInformation Class to check if these APIs are available in current system when you launch the app.

You could refer this link for more information about how to use this API: https://docs.microsoft.com/en-us/windows/uwp/debug-test-perf/version-adaptive-code

You could get more information about create a version adaptive app here:

 Version adaptive apps: Use new APIs while maintaining compatibility with previous versions

Dynamically detecting features with API contracts (10 by 10)

Best regards,

Roy


这篇关于[UWP] Windows 10s OS全名/ OS-SKU在UWP中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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