protected void Button1_Click(object sender, EventArgs e)
        {
            DateTime date = DateTime.Parse(TextBox4.Text);
            bool     ok   = CaptchaBox.Validate(TextBox7.Text);

            TextBox7.Text = null;
            if (!ok)
            {
                Label8.ForeColor = System.Drawing.Color.Red;
                Label8.Text      = "Invalid";
            }
            else
            {
                Label8.ForeColor = System.Drawing.Color.Green;
                Label8.Text      = "Valid";
                con.Open();
                SqlCommand cmd = new SqlCommand("insert into Users1(Id,EmailAddress,Password,FirstName,LastName,DOB) values (@Id,@EmailAddress,@Password,@FirstName,@LastName,@DOB)", con);
                cmd.Parameters.AddWithValue("@Id", Label10.Text);
                cmd.Parameters.AddWithValue("@EmailAddress", TextBox3.Text);
                cmd.Parameters.AddWithValue("@Password", TextBox5.Text);
                cmd.Parameters.AddWithValue("@FirstName", TextBox1.Text);
                cmd.Parameters.AddWithValue("@LastName", TextBox2.Text);
                cmd.Parameters.AddWithValue("@DOB", date);


                cmd.ExecuteNonQuery();
                con.Close();
                getId();

                Response.Redirect("login.aspx");
            }
        }
Esempio n. 2
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection(connect);

            con.Open();
            bool correct = CaptchaBox.Validate(txtCaptcha.Text);

            txtCaptcha.Text = null;
            if (correct)
            {
                if (con.State == System.Data.ConnectionState.Open)
                {
                    string     insert = "INSERT INTO Signup(first_name, last_name, Username, password)values('" + TextBox1.Text.ToString() + "','" + TextBox2.Text.ToString() + "','" + TextBox3.Text.ToString() + "','" + TextBox5.Text.ToString() + "')";
                    SqlCommand cmd    = new SqlCommand(insert, con);
                    cmd.ExecuteNonQuery();
                    Response.Redirect("Login.aspx");
                }
                else
                {
                    Response.Write("Please enter all the details");
                }
            }
            else
            {
                Response.Write("Invalid captcha");
            }
        }
        protected void captcha_button_Click(object sender, EventArgs e)
        {
            bool ishuman = CaptchaBox.Validate(txtCaptcha.Text);

            txtCaptcha.Text = null;
            if (!ishuman)
            {
                Label1.Text = "Invalid";
            }
            else
            {
                Label1.Text = "valid";
            }
        }
Esempio n. 4
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            bool ishuman = CaptchaBox.Validate(textCaptcha.Text);

            textCaptcha.Text = null;
            if (!ishuman)
            {
                Labelmsg.ForeColor = System.Drawing.Color.Red;
                Labelmsg.Text      = "InValid";
            }
            else
            {
                Labelmsg.ForeColor = System.Drawing.Color.Green;
                Labelmsg.Text      = "Valid";
            }
        }
Esempio n. 5
0
 private void LoginBox_KeyDown(object sender, Windows.UI.Xaml.Input.KeyRoutedEventArgs e)
 {
     if (e.Key == VirtualKey.Enter)
     {
         if (!string.IsNullOrWhiteSpace(LoginBox.Text))
         {
             if (string.IsNullOrWhiteSpace(PasswordBox.Password))
             {
                 PasswordBox.Focus(FocusState.Keyboard);
             }
             else if (CaptchaForm.Visibility == Visibility.Visible && string.IsNullOrWhiteSpace(CaptchaBox.Text))
             {
                 CaptchaBox.Focus(FocusState.Keyboard);
             }
             else
             {
                 ViewModel.LoginCommand.Execute(null);
             }
         }
     }
 }
Esempio n. 6
0
 private void PasswordBox_OnKeyDown(object sender, KeyRoutedEventArgs e)
 {
     if (e.Key == VirtualKey.Enter)
     {
         if (!string.IsNullOrWhiteSpace(PasswordBox.Password))
         {
             if (string.IsNullOrWhiteSpace(LoginBox.Text))
             {
                 LoginBox.Focus(FocusState.Keyboard);
             }
             else if (CaptchaForm.Visibility == Visibility.Visible && string.IsNullOrWhiteSpace(CaptchaBox.Text))
             {
                 CaptchaBox.Focus(FocusState.Keyboard);
             }
             else
             {
                 ((LoginViewModel)DataContext).LoginCommand.Execute(null);
             }
         }
     }
 }
        protected void Button1_Click(object sender, EventArgs e)
        {
            bool isHuman = CaptchaBox.Validate(TxtCaptcha.Text);

            TxtCaptcha.Text = null;
            if (!isHuman)
            {
                LabelMsg.Text = "Invalid Captacha";
            }
            else
            {
                try
                {
                    SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
                    conn.Open();//Add data to the sql database
                    string     insertQuery = "insert into signUP(emailId,firstName,lastName,userName,password,confirmPassword,age)values (@emailId,@firstName,@lastName,@userName,@password,@confirmPassword,@age)";
                    SqlCommand cmd         = new SqlCommand(insertQuery, conn);
                    cmd.Parameters.AddWithValue("@emailId", emailId.Text);
                    cmd.Parameters.AddWithValue("@firstName", firstName.Text);
                    cmd.Parameters.AddWithValue("@lastName", lastName.Text);
                    cmd.Parameters.AddWithValue("@password", password.Text);
                    cmd.Parameters.AddWithValue("@confirmPassword", confirmPassword.Text);
                    cmd.Parameters.AddWithValue("@userName", userName.Text);
                    cmd.Parameters.AddWithValue("@age", age.Text);
                    cmd.ExecuteNonQuery();

                    Response.Write("Sign Up Successfully!!!thank you");

                    conn.Close();
                }
                //catch errors
                catch (Exception ex)
                {
                    Response.Write("error" + ex.ToString());
                    LabelMsg.Text = "Valid Captcha";
                    Response.Redirect("LogIn.aspx");
                }
            }
        }
Esempio n. 8
0
        protected void Button1_Click1(object sender, EventArgs e)
        {
            bool isHuman = CaptchaBox.Validate(TxtCaptcha.Text);

            TxtCaptcha.Text = null;
            if (!isHuman)
            {
                LabelMsg.Text = "Invalid Captacha";
            }
            else
            {
                try
                {
                    SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
                    conn.Open();//Add data to the sql database
                    string     insertQuery = "insert into tbl(username,password,confirmpassword)values (@username,@password,@confirmpassword)";
                    SqlCommand cmd         = new SqlCommand(insertQuery, conn);
                    cmd.Parameters.AddWithValue("@username", username.Text);
                    cmd.Parameters.AddWithValue("@password", password.Text);
                    cmd.Parameters.AddWithValue("@confirmpassword", confirmpassword.Text);

                    cmd.ExecuteNonQuery();



                    conn.Close();
                }
                //catch errors
                catch (Exception ex)
                {
                    Response.Write("error" + ex.ToString());
                }

                LabelMsg.Text = "Valid Captcha";
                Response.Redirect("LogIn.aspx");
            }
        }
Esempio n. 9
0
        protected void Button1_Click(object sender, EventArgs e)

        {
            bool isHuman = CaptchaBox.Validate(TxtCaptcha.Text);

            TxtCaptcha.Text = null;
            if (!isHuman)
            {
                Label1.Text = "Invalid Captacha";
            }
            else
            {
                try
                {
                    SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["Database2ConnectionString"].ConnectionString);
                    conn.Open();//Add data to the sql database
                    string     insertQuery = "insert into SignUpTable(Username, Password, ConfirmPassword)values (@Username,@Password,@ConfirmPassword)";
                    SqlCommand cmd         = new SqlCommand(insertQuery, conn);
                    cmd.Parameters.AddWithValue("@Username", Username.Text);
                    cmd.Parameters.AddWithValue("@Password", Password.Text);
                    cmd.Parameters.AddWithValue("@ConfirmPassword", ConfirmPassword.Text);

                    cmd.ExecuteNonQuery();

                    Response.Write("Student registeration Successfully!!!thank you");

                    conn.Close();
                }//catch errors
                catch (Exception ex)
                {
                    Response.Write("error" + ex.ToString());
                }

                Response.Redirect("SignIn.aspx");
            }
        }