예제 #1
0
        /// <summary>
        /// 功能代码
        /// </summary>
        private void Holle_Gn()
        {
            //存储数据的字节
            byte[] data;
            //收到信息的长度
            int length = 0;
            while (true)
            {
                //接收到远程的连接
                Socket remoteClient = Ckgn.Accept();
                //重新初始化下接收数据的变量 防止连续接收时数据叠加
                StringBuilder receiveData = new StringBuilder();

                data = new byte[1024];
                length = remoteClient.Receive(data);

                string wi = Encoding.UTF8.GetString(data);
                if (wi.IndexOf("远程请求") != -1)
                {
                    string[] fg = remoteClient.RemoteEndPoint.ToString().Split(":".ToCharArray());

                    Debug.WriteLine(fg[0]);
                    YcLj a = new YcLj();
                    a.xz = fg[0];
                    xz = fg[0];
                    a.ShowDialog();

                }
            }
        }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (comboBox1.Text.Length == 0) { MessageBox.Show("请重新确认!"); return; }

            xz = comboBox1.Text;

            YcLj a = new YcLj();
            a.Show();
        }