Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.44 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using MaterialSkin;
  11. using MaterialSkin.Controls;
  12. using System.Management;
  13. using WindowsFormsApp16.Properties;
  14.  
  15. namespace WindowsFormsApp16
  16. {
  17. public partial class Form2 : MaterialForm
  18. {
  19. public Form2()
  20. {
  21.  
  22. var materialSkinManager = MaterialSkinManager.Instance;
  23. materialSkinManager.AddFormToManage(this);
  24. materialSkinManager.Theme = MaterialSkinManager.Themes.DARK;
  25. materialSkinManager.ColorScheme = new ColorScheme(Primary.Red800, Primary.Red700
  26. , Primary.Orange400, Accent.Orange200, TextShade.WHITE);
  27. InitializeComponent();
  28. Init_Data();
  29. }
  30.  
  31.  
  32.  
  33. private void Form2_Load(object sender, EventArgs e)
  34. {
  35.  
  36. }
  37.  
  38. private void materialLabel1_Click(object sender, EventArgs e)
  39. {
  40.  
  41. }
  42.  
  43. private void Init_Data()
  44. {
  45. if (Properties.Settings.Default.UserName != string.Empty)
  46. {
  47. if (Properties.Settings.Default.Remme == "yes")
  48. {
  49. materialSingleLineTextField1.Text = Properties.Settings.Default.UserName;
  50. materialSingleLineTextField2.Text = Properties.Settings.Default.Password;
  51. materialCheckBox1.Checked = true;
  52. }
  53. else
  54. {
  55. materialSingleLineTextField1.Text = Properties.Settings.Default.UserName;
  56. }
  57. }
  58. }
  59. private void Save_Data()
  60. {
  61. if (materialCheckBox1.Checked)
  62. {
  63. Properties.Settings.Default.UserName = materialSingleLineTextField1.Text;
  64. Properties.Settings.Default.Password = materialSingleLineTextField2.Text;
  65. Properties.Settings.Default.Remme = "yes";
  66. Properties.Settings.Default.Save();
  67. }
  68. else
  69. {
  70. Properties.Settings.Default.UserName = materialSingleLineTextField1.Text;
  71. Properties.Settings.Default.Password = "";
  72. Properties.Settings.Default.Remme = "no";
  73. Properties.Settings.Default.Save();
  74. }
  75.  
  76. }
  77.  
  78. private void materialRaisedButton1_Click(object sender, EventArgs e)
  79. {
  80. string[] users = { "Justindhd", "mysterious"};
  81. string[] pass = { "1234", "teamspix"};
  82. string hwid = GetHWID();
  83.  
  84. if (users.Contains(materialSingleLineTextField1.Text) && pass.Contains(materialSingleLineTextField2.Text) && Array.IndexOf(users, materialSingleLineTextField1.Text) == Array.IndexOf(pass, materialSingleLineTextField2.Text))
  85. {
  86. Save_Data();
  87. if (hwid == "BFEBFBFF00030678")
  88. {
  89.  
  90. MessageBox.Show("Welcome to the script hub!", "Login Success");
  91.  
  92. Form1 ss = new Form1();
  93. this.Hide();
  94. ss.Show();
  95. }
  96. else if (hwid == "BFEBFBFF000306A9")
  97. {
  98.  
  99.  
  100.  
  101.  
  102. MessageBox.Show("Welcome to the script hub!", "Login Success");
  103.  
  104. Form1 ss = new Form1();
  105. this.Hide();
  106. ss.Show();
  107. }
  108. else
  109. {
  110. MessageBox.Show("Your login was right but your hwid does not match! (hwid copied to clipboard)", "Login Fail");
  111. Clipboard.SetText(hwid);
  112. Environment.Exit(0);
  113. }
  114.  
  115. }
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125. }
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140. private string GetHWID()
  141. {
  142. string empty = string.Empty;
  143. foreach (ManagementObject instance in new ManagementClass("win32_processor").GetInstances())
  144. {
  145. if (string.IsNullOrEmpty(empty))
  146. {
  147. empty = instance.GetPropertyValue("processorID").ToString();
  148. break;
  149. }
  150. }
  151. return empty;
  152. }
  153.  
  154. private void materialSingleLineTextField2_Click(object sender, EventArgs e)
  155. {
  156.  
  157. }
  158. }
  159. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement