示例#1
0
        private async void button1_Click(object sender, EventArgs e)
        {
            try
            {
                FirebaseResponse response1 = await client.GetTaskAsync("Logindetails/" + textBox1.Text);

                LData obj = response1.ResultAs <LData>();
                if (obj.username == textBox1.Text && obj.password == textBox2.Text)
                {
                    Mainform f4 = new Mainform();
                    this.Hide();
                    f4.FormClosed += (s, args) => this.Close();
                    f4.Show();
                    f4.Focus();
                }
                else
                {
                    MessageBox.Show("Username and Password not match!");
                }
            }
            catch
            {
                MessageBox.Show("Username and Password not match!");
            }
        }
示例#2
0
        private async void button1_Click(object sender, EventArgs e)
        {
            var data1 = new LData
            {
                username = textBox1.Text,
                email    = textBox2.Text,
                password = textBox3.Text
            };

            try
            {
                FirebaseResponse response1 = await client.GetTaskAsync("Logindetails/" + textBox1.Text);

                LData obj = response1.ResultAs <LData>();
                if (obj.username == textBox1.Text)
                {
                    FirebaseResponse response = await client.UpdateTaskAsync("Logindetails/" + textBox1.Text, data1);

                    LData result = response.ResultAs <LData>();
                    MessageBox.Show("Password Successfully Updated!");
                }
                else
                {
                    MessageBox.Show("Username not found!");
                }
            }
            catch
            {
                MessageBox.Show("Username not found!");
            }

            LoginForm f1 = new LoginForm();

            f1.Show();
            this.Hide();
        }
        private async void button1_Click(object sender, EventArgs e)
        {
            var data1 = new LData
            {
                username = textBox1.Text,
                email    = textBox2.Text,
                password = textBox3.Text
            };

            if (textBox3.Text == textBox4.Text)
            {
                try
                {
                    FirebaseResponse response1 = await client.GetTaskAsync("Logindetails/" + textBox1.Text);

                    LData obj = response1.ResultAs <LData>();
                    errorProvider1.SetError(textBox1, "Username already exists!");
                }
                catch
                {
                    SetResponse response = await client.SetTaskAsync("Logindetails/" + textBox1.Text, data1);

                    LData result = response.ResultAs <LData>();

                    MessageBox.Show("You have Signed Up Successfully!");

                    LoginForm f1 = new LoginForm();
                    f1.Show();
                    this.Hide();
                }
            }
            else
            {
                errorProvider2.SetError(textBox4, "Passwords didn't match!");
            }
        }