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