コード例 #1
0
        private void button_Reg_Click(object sender, EventArgs e)
        {
            SqlConnection sqlConnect = Class_Connection_DB.DatabaseSQL();

            using (sqlConnect)
            {
                try
                {
                    string passwordCheck = GetHash(textBox_Password.Text);
                    sqlConnect.Open();
                    SqlCommand sqlCommand = new SqlCommand("Autoriz_Insert", sqlConnect)
                    {
                        CommandType = CommandType.StoredProcedure
                    };
                    sqlCommand.Parameters.AddWithValue("@Login_", textBox_Login.Text);
                    sqlCommand.Parameters.AddWithValue("@Pasword_", passwordCheck);
                    sqlCommand.ExecuteNonQuery();
                    MessageBox.Show("Регистрация прошла успешно.", "Уведомление");
                    Form_Autorization form = new Form_Autorization();
                    form.Show();
                    this.Close();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Какие либо данные введены не корректно." + ex, "Ошибка");
                }
            }
        }
コード例 #2
0
 private void timer1_Tick(object sender, EventArgs e)
 {
     if (progressBar1.Value == 100)
     {
         Form_Autorization form_Autorization = new Form_Autorization();
         form_Autorization.Show();
         timer1.Enabled = false;
         this.Hide();
     }
     else
     {
         progressBar1.Value += 10;
     }
 }