Пример #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (myPort != null)
     {
         return;
     }
     myPort               = new SerialPortProcessor(this);
     myPort.PortName      = "COM4";
     myPort.BoudRate      = 4800;
     myPort.DataBits      = 8;
     myPort.Parity        = Parity.None;
     myPort.StopBits      = StopBits.One;
     myPort.DataReceived += DataReceivedHandler;
     myPort.Start();
 }
        public static void ReceiveWork(object target)
        {
            SerialPortProcessor my = target as SerialPortProcessor;

            my.ReciveData();
        }