예제 #1
0
        private void buttonSet_Click(object sender, EventArgs e)
        {
            ts = new transducerServer();
            transducerServer.curtainIp = this.textCurtainIP.Text;//IP
            transducerServer.transIp   = this.textTranLightIP.Text;
            var temp = this.textFreq.Text;
            int numTemp;

            int.TryParse(temp, out numTemp);
            transducerServer.freq = numTemp;//频率
            temp = this.textCurtainPort.Text;
            int.TryParse(temp, out numTemp);
            transducerServer.curtainPort = numTemp;//端口
            temp = this.textTranLightPort.Text;
            int.TryParse(temp, out numTemp);
            transducerServer.transPort = numTemp;
            temp = this.textLight.Text;
            int.TryParse(temp, out numTemp);
            transducerServer.lightCheck = numTemp;//亮度值
            if (ts.socketCurtainCreate() && ts.socketTransCreate())
            {
                MessageBox.Show("连接成功,请稍等");
                createSocket();
            }
            else
            {
                MessageBox.Show("连接失败或数据异常");
            }
        }
예제 #2
0
        private void control_Load(object sender, EventArgs e)
        {
            ts = new transducerServer();
            ts.thStart();

            this.timer1.Interval = 1000;
            this.timer1.Start();
        }