简体   繁体   English

我们如何在Windows Phone 8.1应用中检测Windows 10?

[英]How can we detect Windows 10 in Windows Phone 8.1 app?

my app (developed in Windows Phone 8.1 RT environment) uses OpenFilePicker which allows me to choose image and capture an image, it works great however when I deployed this app on a Windows 10 device, this function just allowed me to pick an image from the library. 我的应用程序(在Windows Phone 8.1 RT环境中开发)使用OpenFilePicker,它使我可以选择图像并捕获图像,它的工作原理很棒,但是当我将此应用程序部署到Windows 10设备上时,此功能只允许我从Windows 10设备中选择图像。图书馆。 I thought about a solution, writing a small code block which can help me to detect the version of the OS like this 我考虑了一个解决方案,编写了一个小的代码块,它可以帮助我检测像这样的操作系统版本

#if WINDOWS_PHONE_APP
//codes
#endif

But I don't know exactly what I need to do, so please help me! 但是我不知道该怎么做,所以请帮助我!

Read this link: 阅读此链接:

Windows Store Apps: Get OS Version, beginners tutorials (C#-XAML) Windows应用商店应用:获取操作系统版本,初学者教程(C#-XAML)

it purpose a simple solution to check is OS has Windows 10 features with reflection: 目的是要检查一个简单的解决方案,使其具有Windows 10具有反射功能的操作系统:

var analyticsInfoType = Type.GetType("Windows.System.Profile.AnalyticsInfo, Windows, ContentType=WindowsRuntime"); 
var versionInfoType = Type.GetType("Windows.System.Profile.AnalyticsVersionInfo, Windows, ContentType=WindowsRuntime"); 

if (analyticsInfoType == null || versionInfoType == null) 
{ 
 // That's not Windows 10
} 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM