Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 4.62 KB | None | 0 0
  1. public void createlicensedefault()
  2.         {
  3.             if (crystalClearTextBox1.Text == "")
  4.             {
  5.                 MessageBox.Show("Can't create license because of blank license field.");
  6.             }
  7.             else
  8.             {
  9.                 int token = 1;
  10.                 string license = crystalClearTextBox1.Text;
  11.                 MySqlConnection conn = new MySqlConnection("server=IP;user id=login;Password=password;database=mysqllogin");
  12.                 MySqlDataAdapter sda = new MySqlDataAdapter("select count(*) from defaultaccount where 1 = '" + token + "' and license = '" + license + "'", conn);
  13.                 DataTable dt = new DataTable();
  14.                 sda.Fill(dt);
  15.                 if (dt.Rows[0][0].ToString() == "1")
  16.                 {
  17.                     MessageBox.Show("A default license already exists with this key.");
  18.                 }
  19.                 else
  20.                 {
  21.                     MySqlConnection conn2 = new MySqlConnection("server=IP;user id=login;Password=password;database=mysqllogin");
  22.                     MySqlDataAdapter sda2 = new MySqlDataAdapter("select count(*) from premiumaccount where 1 = '" + token + "' and license = '" + license + "'", conn2);
  23.                     DataTable dt2 = new DataTable();
  24.                     sda2.Fill(dt2);
  25.                     if (dt2.Rows[0][0].ToString() == "1")
  26.                     {
  27.                         MessageBox.Show("A premium license already exists with this key.");
  28.                     }
  29.                     else
  30.                     {
  31.                         MySqlCommand cmd;
  32.                         MySqlConnection con = new MySqlConnection("server=IP;user id=login;Password=password;database=mysqllogin");
  33.                         con.Open();
  34.                         cmd = new MySqlCommand("INSERT INTO defaultaccount (1,license,2,3) VALUES (@1,@license,@2,@3)", con);
  35.                         cmd.Parameters.Add("@1", "1");
  36.                         cmd.Parameters.Add("@license", crystalClearTextBox1.Text);
  37.                         cmd.Parameters.Add("@2", "1");
  38.                         cmd.Parameters.Add("@3", "1");
  39.                         cmd.ExecuteNonQuery();
  40.                         MessageBox.Show("License created...");
  41.                     }
  42.                 }
  43.             }
  44.         }
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58. //ban id
  59. if(crystalClearTextBox2.Text == "CPU ID")
  60.             {
  61.                 MessageBox.Show("Please enter a valid CPU ID");
  62.             }
  63.             else if(crystalClearTextBox2.Text == "")
  64.             {
  65.                 MessageBox.Show("Please enter a valid CPU ID");
  66.             }
  67.             else
  68.             {
  69.                 int token = 1;
  70.                 string cpuid = crystalClearTextBox2.Text;
  71.                 MySqlConnection conn = new MySqlConnection("server=IP;user id=login;Password=password;database=bannedcpu");
  72.                 MySqlDataAdapter sda = new MySqlDataAdapter("select count(*) from bannedcpu where 1 = '" + token + "' and cpuid = '" + cpuid + "'", conn);
  73.                 DataTable dt = new DataTable();
  74.                 sda.Fill(dt);
  75.                 if (dt.Rows[0][0].ToString() == "1")
  76.                 {
  77.                     MessageBox.Show("This CPU ID is already banned.");
  78.                 }
  79.                 else
  80.                 {
  81.                     MySqlCommand cmd;
  82.                     MySqlConnection con = new MySqlConnection("server=IP;user id=login;Password=password;database=bannedcpu");
  83.                     con.Open();
  84.                     cmd = new MySqlCommand("INSERT INTO bannedcpu (1,cpuid) VALUES (@1,@cpuid)", con);
  85.                     cmd.Parameters.Add("@1", "1");
  86.                     cmd.Parameters.Add("@cpuid", crystalClearTextBox2.Text);
  87.                     cmd.ExecuteNonQuery();
  88.  
  89.  
  90.                 }
  91.             }
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100. //login script
  101. string username = crystalClearTextBox1.Text;
  102.             string password = crystalClearTextBox2.Text;
  103.             MySqlConnection conn = new MySqlConnection("server=;user id=login;Password=;database=keypanel");
  104.             MySqlDataAdapter sda = new MySqlDataAdapter("select count(*) from keypanellogin where username = '" + username + "' and password = '" + password + "'", conn);
  105.             DataTable dt = new DataTable();
  106.             sda.Fill(dt);
  107.             if (dt.Rows[0][0].ToString() == "1")
  108.             {
  109.                 MessageBox.Show("Welcome back " + username + " :)");
  110.                 this.Hide();
  111.                 Form main = new Main();
  112.                 main.Show();
  113.             }
  114.             else
  115.             {
  116.                 MessageBox.Show("Incorrect username/password.");
  117.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement