简体   繁体   中英

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. 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)

it purpose a simple solution to check is OS has Windows 10 features with reflection:

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
} 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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