Example #1
0
        private void backButton_Click(object sender, EventArgs e)
        {
            //switches back to previous screen
            this.Hide();
            SelectScreen selectScreen = new SelectScreen();

            selectScreen.ShowDialog();
            this.Close();
        }
Example #2
0
        private void login_Click(object sender, EventArgs e)
        {
            //assigns the typed in username to string for verification
            typedUserName = textBox1.Text;
            //makes a string array from the user names file to check to see if the user name exists
            string[] userList = System.IO.File.ReadAllLines(System.IO.Path.GetFullPath(@"data\UserNames.txt"));

            foreach (string user in userList){
                if (user.Equals(typedUserName, StringComparison.InvariantCultureIgnoreCase))
                {
                    this.Hide();
                    SelectScreen selectScreen = new SelectScreen();
                    selectScreen.ShowDialog();
                    this.Close();
                }
                else
                {
                    errorMessageText.Text = "User Not On File";
                }
            }
        }