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

How to get list of paired bluetooth devices on Windows 10 Universal Application

我正在寻找如何在 Windows 10 通用应用程序中获取配对蓝牙设备的列表,但没有找到任何东西。在 Windows 8.1 应用程序上有很多如何执行此操作的信息,但 none 的解决方案适用于 Windows 10 通用应用程序。

我自己找到了答案。在 UWA 中很容易获得配对的蓝牙设备。这是代码片段:

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