Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void createlicensedefault()
- {
- if (crystalClearTextBox1.Text == "")
- {
- MessageBox.Show("Can't create license because of blank license field.");
- }
- else
- {
- int token = 1;
- string license = crystalClearTextBox1.Text;
- MySqlConnection conn = new MySqlConnection("server=IP;user id=login;Password=password;database=mysqllogin");
- MySqlDataAdapter sda = new MySqlDataAdapter("select count(*) from defaultaccount where 1 = '" + token + "' and license = '" + license + "'", conn);
- DataTable dt = new DataTable();
- sda.Fill(dt);
- if (dt.Rows[0][0].ToString() == "1")
- {
- MessageBox.Show("A default license already exists with this key.");
- }
- else
- {
- MySqlConnection conn2 = new MySqlConnection("server=IP;user id=login;Password=password;database=mysqllogin");
- MySqlDataAdapter sda2 = new MySqlDataAdapter("select count(*) from premiumaccount where 1 = '" + token + "' and license = '" + license + "'", conn2);
- DataTable dt2 = new DataTable();
- sda2.Fill(dt2);
- if (dt2.Rows[0][0].ToString() == "1")
- {
- MessageBox.Show("A premium license already exists with this key.");
- }
- else
- {
- MySqlCommand cmd;
- MySqlConnection con = new MySqlConnection("server=IP;user id=login;Password=password;database=mysqllogin");
- con.Open();
- cmd = new MySqlCommand("INSERT INTO defaultaccount (1,license,2,3) VALUES (@1,@license,@2,@3)", con);
- cmd.Parameters.Add("@1", "1");
- cmd.Parameters.Add("@license", crystalClearTextBox1.Text);
- cmd.Parameters.Add("@2", "1");
- cmd.Parameters.Add("@3", "1");
- cmd.ExecuteNonQuery();
- MessageBox.Show("License created...");
- }
- }
- }
- }
- //ban id
- if(crystalClearTextBox2.Text == "CPU ID")
- {
- MessageBox.Show("Please enter a valid CPU ID");
- }
- else if(crystalClearTextBox2.Text == "")
- {
- MessageBox.Show("Please enter a valid CPU ID");
- }
- else
- {
- int token = 1;
- string cpuid = crystalClearTextBox2.Text;
- MySqlConnection conn = new MySqlConnection("server=IP;user id=login;Password=password;database=bannedcpu");
- MySqlDataAdapter sda = new MySqlDataAdapter("select count(*) from bannedcpu where 1 = '" + token + "' and cpuid = '" + cpuid + "'", conn);
- DataTable dt = new DataTable();
- sda.Fill(dt);
- if (dt.Rows[0][0].ToString() == "1")
- {
- MessageBox.Show("This CPU ID is already banned.");
- }
- else
- {
- MySqlCommand cmd;
- MySqlConnection con = new MySqlConnection("server=IP;user id=login;Password=password;database=bannedcpu");
- con.Open();
- cmd = new MySqlCommand("INSERT INTO bannedcpu (1,cpuid) VALUES (@1,@cpuid)", con);
- cmd.Parameters.Add("@1", "1");
- cmd.Parameters.Add("@cpuid", crystalClearTextBox2.Text);
- cmd.ExecuteNonQuery();
- }
- }
- //login script
- string username = crystalClearTextBox1.Text;
- string password = crystalClearTextBox2.Text;
- MySqlConnection conn = new MySqlConnection("server=;user id=login;Password=;database=keypanel");
- MySqlDataAdapter sda = new MySqlDataAdapter("select count(*) from keypanellogin where username = '" + username + "' and password = '" + password + "'", conn);
- DataTable dt = new DataTable();
- sda.Fill(dt);
- if (dt.Rows[0][0].ToString() == "1")
- {
- MessageBox.Show("Welcome back " + username + " :)");
- this.Hide();
- Form main = new Main();
- main.Show();
- }
- else
- {
- MessageBox.Show("Incorrect username/password.");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement