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.Windows.Forms;
- namespace tutorial1
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- }
- private void button1_Click(object sender, EventArgs e)
- {
- string username;
- string password;
- username = textBox1.Text;
- password = textBox2.Text;
- ValuesToShare.pass = "password";
- ValuesToShare.user = "username";
- if ((username == "Root") && (password == "Root"))
- {
- ValuesToShare.pressed = true;
- this.Close();
- }
- else
- {
- MessageBox.Show("Invalid username/password. Please try again.", "Error");
- // textBox1.ResetText; Going to do a while loop so it will keep retrying for password
- // textBox2.ResetText; Also, need to make the textboxes clear after a failed login
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement