private void ForgotPass_Load(object sender, EventArgs e) { inputStream = File.OpenText("C:\\IntelTechs\\files\\Users.txt"); string line; int count = 0; line = inputStream.ReadLine(); while (line != null) { a = line.Split(','); string typeUser = a[0]; string name = a[1]; string lastName = a[2]; string userName = a[3]; string password = a[4]; string question = a[5]; string answer = a[6]; array.Add(user = new ClassUsers(typeUser, name, lastName, userName, password, question, answer)); line = inputStream.ReadLine(); count++; } inputStream.Close(); for (int i = 0; i < array.Count; i++) { comBox_ForgotPass_UserName.Items.Add(array[i].getUserName()); } }
private void FunctionalWindow_Load(object sender, EventArgs e) { inputStream = File.OpenText("C:\\IntelTechs\\files\\Users.txt"); string line; int count = 0; line = inputStream.ReadLine(); while (line != null) { a = line.Split(','); string typeUser = a[0]; string name = a[1]; string lastName = a[2]; string userName = a[3]; string password = a[4]; string question = a[5]; string answer = a[6]; array.Add(user = new ClassUsers(typeUser, name, lastName, userName, password, question, answer)); line = inputStream.ReadLine(); count++; } inputStream.Close(); labelUserName.Text = name + " " + surname; Display(); }
private void comBox_ForgotPass_UserName_SelectedIndexChanged(object sender, EventArgs e) { string user; for (int i = 0; i < array.Count; i++) { user = array[i].getUserName(); if (user.Equals(comBox_ForgotPass_UserName.SelectedItem.ToString())) { labelQuestion.Text = array[i].getQuestion() + "? (Note answer is case sensitive)"; } } labelQuestion.Visible = true; }