문제

I have a hardware which connect with my computer via com interface, I want to implement such a feature: When the button on the hardware is clicked, My application can capture this event and then write something on my application.

So How can I listen to a specific COM interface and capture the event ? How can I get what command the hardware sent to me ?

도움이 되었습니까?

해결책

You're looking for the System.IO.SerialPort class. It will allow you to open a serial port (a COM port) and read and write data. As for the specifics about how to capture a button press, that would depend entirely on the device. If you know that it sends data over the COM port when a button is pressed, then you just need to know what to expect and you'll be able to capture it.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top