Example #1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            IsFirstClick = true;
            this.Button_Start.Enabled = false;
            this.Button_Stop.Enabled  = false;
            this.Button_Pause.Enabled = false;
            ShowThread.PacketArrival += ShowInForm;
            Thread innerDelFileThread = new Thread(DelFileThread);

            innerDelFileThread.IsBackground = true;
            innerDelFileThread.Start();
            Bind = new BindNetworkCard();

            LoadHistory();


            //守护程序用 开线程发送和接收消息,并检测通讯状况
            thSend = new Thread(comm.Send);
            thSend.Start();
            thSend.IsBackground = true;

            thCheck = new Thread(comm.Check);
            thCheck.Start();
            thCheck.IsBackground = true;

            thReceive = new Thread(comm.ReceiveMessages);
            thReceive.Start();
            thReceive.IsBackground = true;

            comm.Restart();
        }
Example #2
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            IsFirstClick = true;
            this.Button_Start.Enabled = false;
            this.Button_Stop.Enabled  = false;
            this.Button_Pause.Enabled = false;
            ShowThread.PacketArrival += ShowInForm;
            Thread innerDelFileThread = new Thread(DelFileThread);

            innerDelFileThread.IsBackground = true;
            innerDelFileThread.Start();
            Bind = new BindNetworkCard();
        }