How to detect Bluetooth dongal has inserted in PC or not?
How to detect Bluetooth dongal has inserted in PC or not using C# code?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jay Krishna ReddyRank #152 · 15.2K reputationPosted Aug 27, 2020, 12:49 AM EDT
2. Implement code to detect paired devices.
This link explains how to find Serial COM ports (including BT devices)
It should be possible to modify the code so you can find paired BT devices only.
Finding Bluetooth paired NXTs with WMI[^]
3. Identify your device.
4. Use polling to see if your device exist in the list or not and is connected.
Polling is easy to implement, but you should do it in a thread so it can be easily aborted.
If the API provides events when devices appears or disappears it is preferable to use the events but I don't know if there is any. You have to read for yourself.
5. If exists, unlock computer; else, lock computer.
This page is for Windows 8 Bluetooth API. I hope it will be helpful.
Bluetooth API[^]
Here is another link using 32feet.NET that should work for Windows 7
Working With Bluetooth Devices Using C# – Part 1[^]