示例#1
0
        private void LoginBtn_Click(object sender, EventArgs e)
        {
            Login loginForm = new Login();

            loginForm.Owner = this;

            if (loginForm.ShowDialog(this) == DialogResult.OK)
            {
                UdpChat = new UdpChat(loginForm.port1, loginForm.port2);

                messageCheck             = new MessageCheck(UdpChat);
                messageCheck.Addusername = AdddUserNAME;
                messageCheck.cancelName  = CancelUserName;
                messageCheck.repeatName  = RepeatUserName;
                messageCheck.addHistory  = AddTextHistory;
                UdpChat.messageCheck     = messageCheck;

                UdpChat.ReceiveStart();

                UdpChat.SendMessage("Online" + username);

                LoginBtn.Enabled = false;
                BtnUpdate();
                onlineStatus = true;
                //TODO: Login -> Username.
            }
            else
            {
                LoginBtn.Enabled = true;
                BtnUpdate();
            }
        }
示例#2
0
 public MessageCheck(UdpChat udpChat)
 {
     udpchat = udpChat;
 }