예제 #1
0
        private void Start_IpSearch()
        {
            StartHeck_flag = 1;//防止跳窗

            string IpSearch_Begin   = "192.168.157.";
            string IpSearch_End     = "192.168.157.";
            string IpSearch_Reflash = "192.168.157."; //用于刷新动态IP

            string Box6_IP  = textBox6.Text;          //获取box6的输入IP
            string Box7_IP  = textBox7.Text;          //获取box7的输入IP
            int    Box_Flag = int.Parse(Box6_IP);;    //动态boxIP


            IpSearch_Begin += textBox6.Text;       //起始IP
            IpSearch_End   += textBox7.Text;       //截止IP
            string IpSearch_Flag = IpSearch_Begin; //动态IP

            while (IpSearch_Flag != IpSearch_End)
            {
                Form2 client = new Form2();
                client.SocketClient(IpSearch_Flag, int.Parse(textBox4.Text));
                client.StartClient();
                Search_Info(IpSearch_Flag);
                client.Close();
                Box_Flag++;
                IpSearch_Flag = IpSearch_Reflash + Convert.ToInt32(Box_Flag);
            }

            StartHeck_flag = 0;
        }
예제 #2
0
        private void button4_Click(object sender, EventArgs e)
        {
            Form2 client = new Form2();

            client.SocketClient(textBox1.Text, int.Parse(textBox4.Text));
            client.StartClient();
            client.Close();
        }