Пример #1
0
        /// <summary>
        /// 此功能负责主机上线的结构体参数添加
        /// 并且显示前台
        /// </summary>
        public void Online(String[] Order_Set)
        {
            Type_Client tc = new Type_Client();

            //加入IP参数
            tc.Ip = ((IPEndPoint)this.socket.RemoteEndPoint).Address.ToString();
            //加入其他参数
            tc.Software      = Order_Set[1];
            tc.Computer_Name = Order_Set[2];
            tc.Customer      = Order_Set[3];
            tc.System_Info   = Order_Set[4];
            tc.Cpu           = Order_Set[5];
            tc.Memory        = Order_Set[6];
            tc.Socket        = this.socket;
            if (tc.Software == "专用版本")
            {
                this.tc = tc;
                this.BeginInvoke(new Pt(this.reFlush_OnlineList));
            }

            //向被控端发送上线成功反馈
            using (NetworkStream Ns = new NetworkStream(tc.Socket))
            {
                Ns.Write(Encoding.Default.GetBytes("$Return||#Online_OK"), 0, Encoding.Default.GetBytes("$Return||#Online_OK").Length);
                Ns.Flush();
            }

            //加入上线主机个数
            Globle.Online_Number++;
            //if (this.timer1.Enabled == false)
            //{
            //    //this.timer1.Enabled = true;
            //    this.timer1.Start();

            //    //MessageBox.Show("timer start!");
            //    //if (this.timer1.Enabled == false) MessageBox.Show("timer error1");
            //    //this.timer1.Tick += timer1_Tick;
            //}
        }
Пример #2
0
        /// <summary>
        /// 此功能负责主机上线的结构体参数添加
        /// 并且显示前台
        /// </summary>
        public void Online(String[] Order_Set)
        {
            Type_Client tc = new Type_Client();
            //加入IP参数
            tc.Ip = ((IPEndPoint)this.socket.RemoteEndPoint).Address.ToString(); 
            //加入其他参数
            tc.Software      = Order_Set[1];
            tc.Computer_Name = Order_Set[2];
            tc.Customer      = Order_Set[3];
            tc.System_Info   = Order_Set[4];
            tc.Cpu           = Order_Set[5];
            tc.Memory        = Order_Set[6];
            tc.Socket        = this.socket;
            if (tc.Software == "专用版本")
            {
                this.tc = tc;
                this.BeginInvoke(new Pt(this.reFlush_OnlineList));
            }

            //向被控端发送上线成功反馈
            using(NetworkStream Ns = new NetworkStream(tc.Socket))
            {
                Ns.Write(Encoding.Default.GetBytes("$Return||#Online_OK"), 0, Encoding.Default.GetBytes("$Return||#Online_OK").Length);
                Ns.Flush();
            }

            //加入上线主机个数
            Globle.Online_Number++;
            //if (this.timer1.Enabled == false)
            //{
            //    //this.timer1.Enabled = true;
            //    this.timer1.Start();
               
            //    //MessageBox.Show("timer start!");
            //    //if (this.timer1.Enabled == false) MessageBox.Show("timer error1");
            //    //this.timer1.Tick += timer1_Tick;
            //}
        }