Advertisement
Guest User

Untitled

a guest
Sep 27th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9.  
  10. namespace tutorial1
  11. {
  12. public partial class Form1 : Form
  13. {
  14.  
  15. public Form1()
  16. {
  17. InitializeComponent();
  18. }
  19.  
  20. private void Form1_Load(object sender, EventArgs e)
  21. {
  22.  
  23. }
  24.  
  25. private void button1_Click(object sender, EventArgs e)
  26. {
  27. string username;
  28. string password;
  29. username = textBox1.Text;
  30. password = textBox2.Text;
  31. ValuesToShare.pass = "password";
  32. ValuesToShare.user = "username";
  33.  
  34. if ((username == "Root") && (password == "Root"))
  35. {
  36. ValuesToShare.pressed = true;
  37. this.Close();
  38. }
  39.  
  40. else
  41. {
  42. MessageBox.Show("Invalid username/password. Please try again.", "Error");
  43. // textBox1.ResetText; Going to do a while loop so it will keep retrying for password
  44. // textBox2.ResetText; Also, need to make the textboxes clear after a failed login
  45. }
  46.  
  47. }
  48.  
  49.  
  50. }
  51.  
  52.  
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement