private void cmdTrennen_Click(object sender, EventArgs e) { AsyClient.SendPacket(Encoding.UTF8.GetBytes(strName + " hat den chat verlassen!")); AsyClient.Disconnect(); cmdTrennen.Enabled = false; cmdSenden.Enabled = false; cmdVerbinden.Enabled = true; }
private void btnLogin_Click(object sender, EventArgs e) { if (!ValidateAdress()) { return; } if (txtUsername.Text != "Admin" || txtPassword.Text != "admin") { return; //Login Abfrage } this.Width = 500; this.Height = 250; gbLogin.Visible = false; gbProperties.Visible = false; btnLogin.Visible = false; tcMain.Visible = true; client.Connect(address, port); client.SendPacket(new Packet("getInfos")); }