Ejemplo n.º 1
0
        private void LogOnX(string username, string password)
        {
            string ip   = System.Configuration.ConfigurationManager.AppSettings["Host"];
            int    port = int.Parse(System.Configuration.ConfigurationManager.AppSettings["Port"]);

            if (!SocketManager.IsConnent)
            {
                if (!SocketManager.Connent(ip, port))
                {
                    MessageBox.Show("无法连接服务器");
                    //Close();
                }
                else
                {
                    SocketManager.StartRead();
                }
            }

            PackHandler.LogOn logon = new PackHandler.LogOn()
            {
                UserName = username,
                PassWord = password
            };

            SocketManager.Send(BufferFormatV2.FormatFCA(logon, Deflate.Compress));
        }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string ip   = System.Configuration.ConfigurationManager.AppSettings["Host"];
            int    port = int.Parse(System.Configuration.ConfigurationManager.AppSettings["Port"]);

            if (!SocketManager.IsConnent)
            {
                if (!SocketManager.Connent(ip, port))
                {
                    MessageBox.Show("无法连接服务器");
                    //Close();
                }
                else
                {
                    SocketManager.StartRead();
                }
            }

            PackHandler.LogOn logon = new PackHandler.LogOn()
            {
                UserName = this.textBox1.Text,
                PassWord = this.textBox2.Text
            };

            SocketManager.Send(BufferFormatV2.FormatFCA(logon, Deflate.Compress));
        }
Ejemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            string ip = System.Configuration.ConfigurationManager.AppSettings["Host"];
            int port = int.Parse(System.Configuration.ConfigurationManager.AppSettings["Port"]);

            if (!SocketManager.IsConnent)
            {
                if (!SocketManager.Connent(ip, port))
                {
                    MessageBox.Show("无法连接服务器");
                    //Close();
                }
                else
                {
                    SocketManager.StartRead();
                }
            }

            PackHandler.LogOn logon = new PackHandler.LogOn()
            {
                UserName = this.textBox1.Text,
                PassWord = this.textBox2.Text
            };

            SocketManager.Send(BufferFormatV2.FormatFCA(logon, Deflate.Compress));



        }
Ejemplo n.º 4
0
        private void LogOnX(string username, string password)
        {
            string ip = System.Configuration.ConfigurationManager.AppSettings["Host"];
            int port = int.Parse(System.Configuration.ConfigurationManager.AppSettings["Port"]);

            if (!SocketManager.IsConnent)
            {
                if (!SocketManager.Connent(ip, port))
                {
                    MessageBox.Show("无法连接服务器");
                    //Close();
                }
                else
                {
                    SocketManager.StartRead();
                }
            }

            PackHandler.LogOn logon = new PackHandler.LogOn()
            {
                UserName = username,
                PassWord = password
            };

            SocketManager.Send(BufferFormatV2.FormatFCA(logon, Deflate.Compress));
        }