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 Authed;
- using Jose.jwe;
- using Newtonsoft.Json;
- namespace ModernDesignLoginForm
- {
- public partial class Form1 : Form
- {
- Auth auth = new Auth();
- AuthedChecker checker = new AuthedChecker();
- public Form1()
- {
- InitializeComponent();
- bool response = auth.Authenticate("Auth here");
- if (response != true)
- {
- MessageBox.Show("Pas connecté");
- Environment.Exit(0);
- }
- }
- private void exitApp_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- private void minimalizeApp_Click(object sender, EventArgs e)
- {
- WindowState = FormWindowState.Minimized;
- }
- private void bunifuTextbox2_OnTextChange(object sender, EventArgs e)
- {
- }
- private void bunifuThinButton21_Click(object sender, EventArgs e)
- {
- string username = bunifuTextbox2.Text;
- string password = bunifuTextbox1.Text;
- bool login = auth.Login(username, password);
- if (login == true)
- {
- MessageBox.Show("Connecté");
- Form3 openForm = new Form3();
- openForm.Show();
- }
- else
- {
- MessageBox.Show("Echouer");
- }
- Properties.Settings.Default.Username = bunifuTextbox2.Text;
- Properties.Settings.Default.Password = bunifuTextbox1.Text;
- Properties.Settings.Default.Save();
- }
- private void label2_Click(object sender, EventArgs e)
- {
- this.Hide();
- Form3 f3 = new Form3();
- f3.ShowDialog();
- this.Close();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- bunifuTextbox2.Text = Properties.Settings.Default.Username;
- bunifuTextbox1.Text = Properties.Settings.Default.Password;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement