title: Login form and Registration form without using database
body: <p>My Instructor gave me and my classmates some three activities and of those activities is to make a simple login form with a registration form without using database (well its obvious that we need to do this activity before proceeding with database).....</p>
  
  <p>Here is the codes:
  Form1:</p>
  
  <pre><code>    public partial class Form1 : Form
      {
          string Username;
          string Password;
          string NAME;
          string Age;
  
          Form2 Frm = new Form2();
  //Here is where you get the value of the String from Form2
          public void PassValue(string strValue)
          {
              Username = strValue;
          }
          public void PassAnotherValue(string strValue2)
          {
              Password = strValue2;
          }
          public void PassAnotherValueAgain(string strValue3)
          {
              NAME = strValue3;
          }
          public void PassAnotherValueAgainAndAgain(string strvalue4)
          {
              Age = strvalue4;
          }
  //------------------------------------------------------------------
          public Form1()
          {
              InitializeComponent();
          }
  
          private void LoginBtn_Click(object sender, EventArgs e)
          {
              if (string.IsNullOrWhiteSpace(LoginUserNameTB.Text))    
              {     
                  MessageBox.Show("Please input proper Username...!");  
              } 
              if (string.IsNullOrWhiteSpace(LoginPasswordTB.Text))    
              {    
                  MessageBox.Show("Please input proper Password...!");
              }    
              else if ((LoginUserNameTB.Text != Username) &amp;&amp; (LoginPasswordTB.Text != Password)) 
              {
                  MessageBox.Show("Welcome" + NAME + "!");    
              }
              else if ((LoginUserNameTB.Text == Username) &amp;&amp; (LoginPasswordTB.Text == Password))  
              {  
                  MessageBox.Show("Please input proper Username and/or Password...!");
              }
          }
  
          private void RegisterBtn1_Click(object sender, EventArgs e)
          {
              Frm.Show();
          }
      }
  }
  </code></pre>
  
  <p>Form2:</p>
  
  <pre><code>//Form2 has four textboxes, four labels, and a button
              private void RegisterBtn2_Click(object sender, EventArgs e)
              {  
                  Form1 obj1 = new Form1();
                  Form1 obj2 = new Form1();
                  Form1 obj3 = new Form1(); 
                  Form1 obj4 = new Form1();   
                  Form1 obj5 = new Form1();
  
          //This is where you pass the String value back to Form1
                      obj1.PassValue(RegUserNameTB.Text);
                      obj2.PassAnotherValue(RegPasswordTB.Text); 
                      obj3.PassAnotherValueAgain(NTB.Text);     
                      obj4.PassAnotherValueAgainAndAgain(ATB.Text);
  
  
                  if (string.IsNullOrWhiteSpace(NTB.Text) &amp;&amp; string.IsNullOrWhiteSpace(ATB.Text) &amp;&amp; string.IsNullOrWhiteSpace(RegUserNameTB.Text) &amp;&amp; string.IsNullOrWhiteSpace(RegPasswordTB.Text))
                      {
                          MessageBox.Show("Please enter the following:" + "\n" + "Name" + "\n" + "Age" + "\n" + "\n" + "UserName" + "\n" + "Password");
                      }   
                  Close();
              }
          }
      }
  </code></pre>
  
  <p>Now to the problem of this program.....
  The program is working just fine and every time I enter a Username and a Password it worked but the value of the 'NAME' is missing and every time I clicked the Register Button it will only perform its action once and never again (probably needs an Exception).... And to sum it up our Instructor told us that the user will have a limit of 3 of entering its username and password and after that the program will close.... Any ideas?</p>