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;
- namespace GymFucker
- {
- public partial class frmLogin : Form
- {
- public frmLogin()
- {
- InitializeComponent();
- Init_Data();
- }
- private void frmLogin_Load(object sender, EventArgs e)
- {
- }
- private void btnLogin_Click(object sender, EventArgs e)
- {
- String username = txtUsername.Text.Trim();
- String password = txtPassword.Text;
- chbxRememberMe.Enabled = true;
- if (username.Equals("EinfachNurYannick")) {
- if (password.Equals("ayy"))
- {
- Save_Data();
- btnLogin.Enabled = false;
- txtUsername.Enabled = false;
- txtPassword.Enabled = false;
- timer1.Start();
- } else {
- MessageBox.Show("The Password is incorrect!");
- }
- } else
- {
- MessageBox.Show("The Username is incorrect!");
- }
- }
- private void btnCancel_Click(object sender, EventArgs e)
- {
- Close();
- }
- private void btnClose_Click(object sender, EventArgs e)
- {
- Close();
- }
- private void timer1_Tick(object sender, EventArgs e)
- {
- if (prgLoad.Value < 100)
- {
- prgLoad.Value++;
- }
- if (prgLoad.Value > 0 && prgLoad.Value < 10)
- {
- lblTitel.ForeColor = Color.AliceBlue;
- lblStatusText.Text = "Is Loading..";
- }
- if (prgLoad.Value > 10 && prgLoad.Value < 20)
- {
- lblTitel.ForeColor = Color.Red;
- }
- if (prgLoad.Value > 20 && prgLoad.Value < 30)
- {
- lblTitel.ForeColor = Color.Green;
- }
- if (prgLoad.Value > 30 && prgLoad.Value < 40)
- {
- lblTitel.ForeColor = Color.BlueViolet;
- lblStatusText.Text = "Loading Modules..";
- lblStatusText.ForeColor = Color.PaleVioletRed;
- prgLoad.ForeColor = Color.PaleVioletRed;
- }
- if (prgLoad.Value > 40 && prgLoad.Value < 50)
- {
- lblTitel.ForeColor = Color.Gray;
- }
- if (prgLoad.Value > 50 && prgLoad.Value < 60)
- {
- lblTitel.ForeColor = Color.LemonChiffon;
- }
- if (prgLoad.Value > 60 && prgLoad.Value < 70)
- {
- lblTitel.ForeColor = Color.LimeGreen;
- lblStatusText.Text = "Finished Programm";
- lblStatusText.ForeColor = Color.ForestGreen;
- prgLoad.ForeColor = Color.ForestGreen;
- }
- if (prgLoad.Value > 70 && prgLoad.Value < 80)
- {
- lblTitel.ForeColor = Color.Gold;
- }
- if (prgLoad.Value > 80 && prgLoad.Value < 90)
- {
- lblTitel.ForeColor = Color.LightSkyBlue;
- }
- if (prgLoad.Value > 90 && prgLoad.Value < 100)
- {
- lblTitel.ForeColor = Color.Lime;
- }
- if (prgLoad.Value == 100)
- {
- timer1.Enabled = false;
- frmMain loader = new frmMain();
- loader.Show();
- this.Hide();
- }
- lblStatusProcent.Text = prgLoad.Value + "%";
- }
- private void pictureBox1_Click(object sender, EventArgs e)
- {
- }
- private void pictureBox1_Click_1(object sender, EventArgs e)
- {
- Close();
- }
- private void label1_Click(object sender, EventArgs e)
- {
- }
- private void Init_Data()
- {
- if (Properties.Settings.Default.UserName != string.Empty)
- {
- if (Properties.Settings.Default.Remme == "yes")
- {
- txtUsername.Text = Properties.Settings.Default.UserName;
- txtPassword.Text = Properties.Settings.Default.Password;
- chbxRememberMe.Checked = true;
- } else
- {
- txtUsername.Text = Properties.Settings.Default.UserName;
- }
- }
- }
- private void Save_Data()
- {
- if (chbxRememberMe.Checked)
- {
- Properties.Settings.Default.UserName = txtUsername.Text.Trim();
- Properties.Settings.Default.Password = txtPassword.Text;
- Properties.Settings.Default.Remme = "yes";
- Properties.Settings.Default.Save();
- } else
- {
- Properties.Settings.Default.UserName = txtUsername.Text.Trim();
- Properties.Settings.Default.Password = "";
- Properties.Settings.Default.Remme = "no";
- Properties.Settings.Default.Save();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement