Advertisement
Guest User

Untitled

a guest
Feb 4th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 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.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace WindowsFormsApplication1
  12. {
  13. public partial class frmLogin : Form
  14. {
  15. public frmLogin()
  16. {
  17. InitializeComponent();
  18. }
  19.  
  20. private void frmLogin_Load(object sender, EventArgs e)
  21. {
  22. string username = txtUsername.Text.Trim();
  23. string password = txtPassword.Text;
  24.  
  25. if (username != "EinfachNurYannick")
  26. {
  27. MessageBox.Show(
  28. String.Format("The User '{0}' does not exist.", username),
  29. "Login Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  30.  
  31. return;
  32. }
  33.  
  34.  
  35.  
  36. if (password != "ayy")
  37. {
  38. MessageBox.Show("The password you have entered ist invalid.", "Login error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  39. return; }
  40.  
  41. frmMain loader = new frmMain(username);
  42. loader.Show();
  43. this.Hide();
  44.  
  45. }
  46.  
  47. private void textBox1_TextChanged(object sender, EventArgs e)
  48. {
  49.  
  50. }
  51.  
  52. private void label1_Click(object sender, EventArgs e)
  53. {
  54.  
  55. }
  56.  
  57. private void label1_Click_1(object sender, EventArgs e)
  58. {
  59.  
  60. }
  61.  
  62. private void Password_TextChanged(object sender, EventArgs e)
  63. {
  64.  
  65. }
  66.  
  67. private void btnLogin_Click(object sender, EventArgs e)
  68. {
  69.  
  70. }
  71. }
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement