using System; using System.IO.Ports; namespace SerialComm { class SerialIn { static void Main () { SerialPort com1 = new SerialPort( "COM12", 9600, Parity.None, 8, StopBits.One ); com1.Open (); do { Console.WriteLine(com1.ReadLine()); } while (!Console.KeyAvailable); com1.Close (); } } }