获取蓝牙设备的名称设备和打印机窗口 [英] Get name of bluetooth device on the Devices and Printers window

查看:967
本文介绍了获取蓝牙设备的名称设备和打印机窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道有问题,在那里指收集有关设备管理器的设备的友好名称,但我不能做到这一点的设备简称为通过蓝牙链接(COM)Stardard串行和我有很多虚拟端口用相同的参考。我想要的设备的名称所示设备和打印机窗口上

I know there are questions out there referring to gathering the friendly name of a device on the Device Manager but I cannot do this as the device is simply referred to as "Stardard Serial over Bluetooth link (COM)" and I have many virtual ports with the same reference. I want the name of the device as shown on the Devices and Printers window on:

我在C#这样做的,目前刚刚起步的系统上可用的COM端口的列表,然后选择一个我从记忆知道。

I'm doing this in C# and currently just getting a list of available COM ports on the system and selecting the one I know from memory.

推荐答案

我设法用它来工作 32Feet.Net

您可以通过执行搜索设备

You can search for a device by doing

    BluetoothClient client = new BluetoothClient();
        devices = client.DiscoverDevicesInRange();
        foreach (BluetoothDeviceInfo d in devices)
        {
            items.Add(d.DeviceName);
        }

这会给你的设备和打印机窗口,而不是标准串行通过蓝牙链接上看到的友好名称的列表。

This will give a list of the friendly names you see on the Devices and Printers window rather than "Standard serial over Bluetooth Link".

如果你想要像我或其他任何一条信息,那么你可以简单地做一个WMI查询,如

If you want the COM port like me or any other piece of information then you can simply do a WMI query such as

    System.Management.ManagementObjectSearcher Searcher = new System.Management.ManagementObjectSearcher("Select * from WIN32_SerialPort");
        foreach (System.Management.ManagementObject Port in Searcher.Get())
        {
             //your comparison or code here
        }

这篇关于获取蓝牙设备的名称设备和打印机窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆