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 SimpleLogin
- {
- public partial class frmLogin : Form
- {
- string username;
- string password;
- public frmLogin()
- {
- InitializeComponent();
- }
- private void btnClose_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- private void frmLogin_Load(object sender, EventArgs e)
- {
- progressBarLogin.ForeColor = Color.LightCyan;
- username = txtUsername.Text.Trim();
- password = txtPassword.Text;
- }
- private void btnLogin_Click(object sender, EventArgs e)
- {
- if (txtUsername.Text.Trim().Equals("EinfachNurCode") && txtPassword.Text.Equals("123456"))
- {
- timer1.Start();
- }
- else
- {
- MessageBox.Show("Username or Password is incorrect!", "Login Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
- txtUsername.Text = "";
- txtPassword.Text = "";
- }
- }
- private void progressBarLogin_Click(object sender, EventArgs e)
- {
- }
- private void timer1_Tick(object sender, EventArgs e)
- {
- progressBarLogin.Value++;
- lblprogressbar.Text = progressBarLogin.Value + "%";
- if(progressBarLogin.Value == 100)
- {
- timer1.Stop();
- frmMain main = new frmMain(username);
- main.Show();
- this.Hide();
- }
- }
- private void txtPassword_TextChanged(object sender, EventArgs e)
- {
- }
- private void btnHidePW_Click(object sender, EventArgs e)
- {
- if(txtPassword.UseSystemPasswordChar == false)
- {
- txtPassword.UseSystemPasswordChar = true;
- } else if(txtPassword.UseSystemPasswordChar == true)
- {
- txtPassword.UseSystemPasswordChar = false;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement