C# 识别Windows Phone设备的正确方法
我正在使用以下代码检索连接到计算机的设备C# 识别Windows Phone设备的正确方法,c#,windows-runtime,windows-phone,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.FindAllAsyn
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?您是否尝试使用Environment.OSVersion
string os = Environment.OSVersion.Version;
有关更多信息,请查看我的代码未在设备上运行。。。从Windows桌面应用程序中,我需要知道计算机上是否连接了有效的Windows Phone设备。