如何在Windows 10通用应用程序上获取配对蓝牙设备的列表

本文关键字:列表 获取 程序上 Windows 10通 应用程序 应用 | 更新日期: 2023-09-27 18:24:16

我正在寻找如何在Windows 10通用应用程序中获得配对蓝牙设备的列表,但没有找到任何东西。有很多关于如何在Windows 8.1应用程序上做到这一点的信息,但没有一个解决方案适用于Windows 10通用应用程序。

如何在Windows 10通用应用程序上获取配对蓝牙设备的列表

我自己找到了答案。在UWA中,配对蓝牙设备非常容易。以下是代码片段:

var selector = BluetoothDevice.GetDeviceSelector();
var devices = await DeviceInformation.FindAllAsync(selector);