Question

I have a working windows form application which is able to read data from Serial Port.Now as per my requirement I have to convert it into Windows Service.In my Windows Form Application I used port1.DataReceived += new SerialDataReceivedEventHandler(port1_DataReceived); to get data from serial port.

Now as per my requirement i have a question Can I use SerialDataReceivedEventHandler in windows Service also to get data from serial port. Here is my code ..

port1.DataReceived += new SerialDataReceivedEventHandler(port1_Data);

Is it the right way to call port1_Data method which reads data from serial port..

Please help me.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top