正确识别Windows Phone设备的方法

时间:2014-06-10 16:20:50

标签: c# windows-runtime windows-phone

我使用以下代码检索连接到计算机的设备

string aqsFilter = "System.Devices.InterfaceClassGuid:=\"{6AC27878-A6FA-4155-BA85-F98F491D4F33}\" AND System.Devices.InterfaceEnabled:=System.StructuredQueryType.Boolean#True";
var interfaces = await DeviceInformation.FindAllAsync(aqsFilter,propertiesToGet);

foreach (var item in interfaces)
{
    Console.WriteLine(item.Name);
    foreach (var p in item.Properties)
    {
        Console.WriteLine("{0}:{1}", p.Key, p.Value);
    }
}

是否有可依赖的属性来确切知道该设备是否为Windows Phone?

1 个答案:

答案 0 :(得分:0)

您是否尝试过使用Environment.OSVersion?

 string os = Environment.OSVersion.Version;

了解详情here