


SerialPort mySerialPort = new SerialPort("COM1") MySerialPort->DataReceived += gcnew SerialDataReceivedEventHandler(DataReceivedHandler) Ĭonsole::WriteLine("Press any key to continue.") MySerialPort->Handshake = Handshake::None SerialPort^ mySerialPort = gcnew SerialPort("COM1") Note that to test this code it is necessary to have hardware attached to COM1 that will send data. This example adds a SerialDataReceivedEventHandler to DataReceived to read all the available data received on the COM1 port.

public:Įvent System::IO::Ports::SerialDataReceivedEventHandler ^ DataReceived public event System.IO.Ports.SerialDataReceivedEventHandler DataReceived member this.DataReceived : System.IO.Ports.SerialDataReceivedEventHandler Public Custom Event DataReceived As SerialDataReceivedEventHandler Public Event DataReceived As SerialDataReceivedEventHandler Event Type SerialDataReceivedEventHandler Examples Indicates that data has been received through a port represented by the SerialPort object.
