// Set the port's settings comport.BaudRate = 9600; comport.DataBits = 7; comport.Parity = Parity.Even; comport.Handshake = Handshake.XOnXOff; comport.RtsEnable = true; comport.ReadTimeout = 500; comport.WriteTimeout = 500; comport.PortName = portname;