Click here to Skip to main content
15,895,656 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Experts,

I have a Device of Bar code Scanning. When i m attaching it to computer then its port is not connection with that.

So i want to know that how to check the device is connected or not?

Thanks
Posted
Comments
OriginalGriff 3-Jun-11 6:38am    
We need more information than that!
How does it connect physically? What happens when you plug it in? Does it have a driver? That sort of thing.
Use the "Improve question" widget to give us the info
Dave Kreskowiak 3-Jun-11 9:50am    
Insufficient information. What kind of scanner is it? How does it connect to the computer? If nothing else, we'd need a make and model number to find out.

There are a variety of different ways to connect barcode scanners to PC's. Depending on the interface type, you may or may not be able to find out if it's attached.

1 solution

I think Windows Management Instrumentation (WMI) should be able to help. Take a look at the following link.

WMI - Win32_DeviceChangeEvent Class[^]

If you can register to this event prior to connecting you device, you should be able to get the notification if the device is connected or not.
 
Share this answer
 
Comments
Dave Kreskowiak 3-Jun-11 9:48am    
This will only work is the scanner is a USB device. It won't work if it's the more common keyboard wedge or for an IP-based scanners.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900