Example #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            string[] lines = File.ReadAllLines(@"C:\Users\MAHE\documents\visual studio 2015\Projects\WindowsFormsApplication1\WindowsFormsApplication1\user.txt");

            for (int i = 0; i < lines.Length; i++)
            {
                string line = lines[i];
                if (line.Equals(name))
                {
                    MessageBox.Show("This username is taken, try again.");
                    i = lines.Length;
                    f = 0;
                    var signup = new signup();
                    signup.Show();
                    this.Hide();
                }
            }

            if (f == 1)
            {
                try
                {
                    String end_character = "\n";
                    File.AppendAllText("C:\\Users\\MAHE\\documents\\visual studio 2015\\Projects\\WindowsFormsApplication1\\WindowsFormsApplication1\\user.txt", name);
                    File.AppendAllText("C:\\Users\\MAHE\\documents\\visual studio 2015\\Projects\\WindowsFormsApplication1\\WindowsFormsApplication1\\user.txt", end_character);
                }
                catch (Exception ee)
                {
                    MessageBox.Show(ee.Message);
                }
                var login = new login();
                login.Show();
                this.Hide();
            }
        }
Example #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            var signup = new signup();

            signup.Show();
            this.Hide();
        }
 private void button3_Click(object sender, EventArgs e)
 {
     // for Sign Up
     if (textBox3.Text == "mianmuhammadanwar")
     {
         textBox3.Text = "";
         signup s = new signup();
         s.Show();
         con.Close();
     }
     else
     {
         MessageBox.Show("You entered WRONG Permission Code", "alert", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Example #4
0
        private void button2_Click(object sender, EventArgs e)
        {
            signup s = new signup();

            s.Show();
        }