コード例 #1
0
        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();
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: kvaoar/devices
        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();
        }