Beispiel #1
0
        private void Login_Button_Click(object sender, EventArgs e)
        {
            try
            {
                string nickname   = loginBox.Text.Substring(0, loginBox.Text.IndexOf("@"));
                string server     = loginBox.Text.Substring(loginBox.Text.IndexOf("@") + 1);
                string connserver = (server == "gmail.com") ? "talk.google.com" : ((server == "haupc") ? "192.168.1.4" : server);

                login = loginBox.Text;
                //[email protected]
                //abe2b33519
                Exit.Show();
                loginBox.Hide();
                passwordBox.Hide();
                Login_Button.Hide();

                //Add_Users.Hide();

                client               = new ClientSide(server, connserver, nickname, passwordBox.Text);
                client.Receive      += new ClientEvent(HandlerOnMessege);
                client.getPresence  += new ClientEvent(HandlerOnPresence);
                client.onLoginEvent += new ClientEvent(HandlerOnLogin);
            }
            catch
            {
                MessageBox.Show("Неверный логин или пароль, попробуйте еще раз");
                loginBox.Show();
                passwordBox.Show();
                Login_Button.Show();
                passwordBox.Clear();
            }
        }
Beispiel #2
0
 private void Login()
 {
     loggedIn = true;
     UsernameBox.Hide();
     PasswordBox.Hide();
     Login_Button.Hide();
     BrugerLabel.Hide();
     KodeLabel.Hide();
     cridentials.Hide();
 }
Beispiel #3
0
 private void Login_Button_Click(object sender, EventArgs e)
 {
     try {
         string nickname   = loginBox.Text.Substring(0, loginBox.Text.IndexOf("@"));
         string server     = loginBox.Text.Substring(loginBox.Text.IndexOf("@") + 1);
         string connserver = (server == "gmail.com") ? "talk.google.com" : ((server == "haupc") ? "192.168.1.3" : server);
         mainJid = new Jid(loginBox.Text);
         Exit.Show();
         loginBox.Hide();
         passwordBox.Hide();
         Login_Button.Hide();
         connectXmpp(server, connserver, nickname, passwordBox.Text);
         //Add_Users.Hide();
     } catch {
         MessageBox.Show("Неверный логин или пароль, попробуйте еще раз");
         loginBox.Show();
         passwordBox.Show();
         Login_Button.Show();
         passwordBox.Clear();
     }
 }
Beispiel #4
0
        private void Login_Click(object sender, EventArgs e)
        {
            Select_ListBox.Items.Clear();
            string   nev     = Nev_TextBox.Text;
            string   jelszo  = Jelszo_TextBox.Text;
            DateTime szuldat = Ev_DateTimePicker.Value;

            using (var conn = new MySqlConnection(
                       "Server=localhost;Database=regisztracio;Uid=root;Password=;"))
            {
                conn.Open();

                var ellenorzes = conn.CreateCommand();
                var command    = conn.CreateCommand();
                ellenorzes.CommandText = "SELECT COUNT(*) from felhasznalo where nev= @nev and jelszo=@jelszo";

                ellenorzes.Parameters.AddWithValue("@jelszo", jelszo);
                ellenorzes.Parameters.AddWithValue("@nev", nev);
                var darab = (long)ellenorzes.ExecuteScalar();
                if (darab == 0)
                {
                    MessageBox.Show("Rossz user nevet vagy jelszót adtál meg");
                    return;
                }

                Kiir();

                Login_Button.Hide();
                Kuld_Button.Hide();
                Delete_Button.Show();
                Logout_Button.Show();
                Select_ListBox.Show();
                Update_Button.Show();
                Select_ListBox.SelectedIndex = 0;
            }
        }