Ejemplo n.º 1
0
        private void ShapeDetection_FormClosing(object sender, FormClosingEventArgs e)
        {
            HomeForm win = new HomeForm();

            win.Show();
            this.Hide();
        }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            String lusername = textBox1.Text;
            String lpassword = textBox2.Text;
            string uname;
            string password;

            using (StreamReader sr = new StreamReader(Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory())) + "\\data.txt"))
            {
                uname    = sr.ReadLine();
                password = sr.ReadLine();
            }

            if (lusername != uname || lpassword != password)
            {
                eror.Text = "Invalid username and/or password";
            }
            else
            {
                HomeForm homeForm = new HomeForm();
                homeForm.Show();
                this.Hide();
            }
        }