Advertisement
DrAungWinHtut

frmLogin.cs

Oct 21st, 2022
1,203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.19 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 IntroductionCsharp
  12. {
  13.     public partial class frmLogin : Form
  14.     {
  15.         public frmLogin()
  16.         {
  17.             InitializeComponent();
  18.         }
  19.  
  20.         private void btnCancel_Click(object sender, EventArgs e)
  21.         {
  22.             Application.Exit();
  23.         }
  24.  
  25.         private void btnSignIn_Click(object sender, EventArgs e)
  26.         {
  27.             string sUname = txtUname.Text;
  28.             string sPassword = txtPass .Text;
  29.            // MessageBox.Show("Username is" + sUname);
  30.            // MessageBox .Show ("Password is"+sPassword);
  31.             if( (sUname  == "aung") && (sPassword == "1234") )
  32.             {
  33.                 MessageBox.Show("Correct Password");
  34.                 // to do
  35.                 frmHello frmHello = new frmHello();
  36.                 frmHello.Show();
  37.                 this.Hide();
  38.             }
  39.             else
  40.             {
  41.                 MessageBox.Show("Incorrect Password");
  42.             }
  43.         }
  44.     }
  45. }
  46.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement