A
A
AlexCruel2020-07-26 18:24:19
C++ / C#
AlexCruel, 2020-07-26 18:24:19

Make waiting for data input from COM3 port?

I use using System.IO.Ports; SerialPort - Windows Forms.
When I bring the card to the reader, there is a signal, that is, data is written to the variable:

str = serialPort1.ReadExisting();

After that, in order to extract the necessary numbers, I hung a method on the button. After pressing it, the required values ​​are displayed.
Is it possible for everything to be automatically read when the card is presented, without pressing the button?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Boris the Animal, 2020-07-26
@AlexCruel

System.IO.Ports.SerialPort has a DataReceived event .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question