M
M
mastersoftna2012-05-29 10:28:08
.NET
mastersoftna, 2012-05-29 10:28:08

How to detect USB device connection in C#?

Tell me which way to dig. It is necessary to determine the connection of the USB device. I use WM_DEVICECHANGE, DBT_DVICEARRIVAL, WndProc. But I only intercept the connection and removal of the flash drive. And I need to receive a message when any USB device is inserted: Bluetooth, Printer, HID, etc. How to implement the above?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Seter17, 2012-05-29
@mastersoftna

ManagementObjectSearcher to help you
msdn.microsoft.com/en-us/library/system.management.managementobjectsearcher.aspx

S
soks, 2012-05-29
@soks

Hello, maybe this will help you somehow

K
kekekeks, 2012-05-30
@kekekeks

www.icsharpcode.net/opensource/sharpusblib/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question