private void Form1_Load(object sender, EventArgs e) { func = new LineReceivedEvent(LineReceived); comboBox1.Items.AddRange(System.IO.Ports.SerialPort.GetPortNames()); if (comboBox1.Items.Count > 0) { comboBox1.Text = comboBox1.Items[comboBox1.Items.Count - 1].ToString(); } udpSENDER = new UdpClient(); udpSENDER.Connect(ip, Int32.Parse(port)); lsnr = new UDPListener(); lsnr.NewMessageReceived += OnReciv; lsnr.StartListener(3); timer1.Start(); }
private void Form1_Load(object sender, EventArgs e) { func = new LineReceivedEvent(LineReceived); comboBox1.Items.AddRange(System.IO.Ports.SerialPort.GetPortNames()); if (comboBox1.Items.Count > 0) comboBox1.Text = comboBox1.Items[comboBox1.Items.Count - 1].ToString(); udpSENDER = new UdpClient(); udpSENDER.Connect(ip, Int32.Parse(port)); lsnr = new UDPListener(); lsnr.NewMessageReceived += OnReciv; lsnr.StartListener(3); timer1.Start(); }