Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using MaterialSkin;
- using MaterialSkin.Controls;
- using System.Management;
- using WindowsFormsApp16.Properties;
- namespace WindowsFormsApp16
- {
- public partial class Form2 : MaterialForm
- {
- public Form2()
- {
- var materialSkinManager = MaterialSkinManager.Instance;
- materialSkinManager.AddFormToManage(this);
- materialSkinManager.Theme = MaterialSkinManager.Themes.DARK;
- materialSkinManager.ColorScheme = new ColorScheme(Primary.Red800, Primary.Red700
- , Primary.Orange400, Accent.Orange200, TextShade.WHITE);
- InitializeComponent();
- Init_Data();
- }
- private void Form2_Load(object sender, EventArgs e)
- {
- }
- private void materialLabel1_Click(object sender, EventArgs e)
- {
- }
- private void Init_Data()
- {
- if (Properties.Settings.Default.UserName != string.Empty)
- {
- if (Properties.Settings.Default.Remme == "yes")
- {
- materialSingleLineTextField1.Text = Properties.Settings.Default.UserName;
- materialSingleLineTextField2.Text = Properties.Settings.Default.Password;
- materialCheckBox1.Checked = true;
- }
- else
- {
- materialSingleLineTextField1.Text = Properties.Settings.Default.UserName;
- }
- }
- }
- private void Save_Data()
- {
- if (materialCheckBox1.Checked)
- {
- Properties.Settings.Default.UserName = materialSingleLineTextField1.Text;
- Properties.Settings.Default.Password = materialSingleLineTextField2.Text;
- Properties.Settings.Default.Remme = "yes";
- Properties.Settings.Default.Save();
- }
- else
- {
- Properties.Settings.Default.UserName = materialSingleLineTextField1.Text;
- Properties.Settings.Default.Password = "";
- Properties.Settings.Default.Remme = "no";
- Properties.Settings.Default.Save();
- }
- }
- private void materialRaisedButton1_Click(object sender, EventArgs e)
- {
- string[] users = { "Justindhd", "mysterious"};
- string[] pass = { "1234", "teamspix"};
- string hwid = GetHWID();
- if (users.Contains(materialSingleLineTextField1.Text) && pass.Contains(materialSingleLineTextField2.Text) && Array.IndexOf(users, materialSingleLineTextField1.Text) == Array.IndexOf(pass, materialSingleLineTextField2.Text))
- {
- Save_Data();
- if (hwid == "BFEBFBFF00030678")
- {
- MessageBox.Show("Welcome to the script hub!", "Login Success");
- Form1 ss = new Form1();
- this.Hide();
- ss.Show();
- }
- else if (hwid == "BFEBFBFF000306A9")
- {
- MessageBox.Show("Welcome to the script hub!", "Login Success");
- Form1 ss = new Form1();
- this.Hide();
- ss.Show();
- }
- else
- {
- MessageBox.Show("Your login was right but your hwid does not match! (hwid copied to clipboard)", "Login Fail");
- Clipboard.SetText(hwid);
- Environment.Exit(0);
- }
- }
- }
- private string GetHWID()
- {
- string empty = string.Empty;
- foreach (ManagementObject instance in new ManagementClass("win32_processor").GetInstances())
- {
- if (string.IsNullOrEmpty(empty))
- {
- empty = instance.GetPropertyValue("processorID").ToString();
- break;
- }
- }
- return empty;
- }
- private void materialSingleLineTextField2_Click(object sender, EventArgs e)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement