private void SystemSettings_Load(object sender, EventArgs e) { inputStream = File.OpenText("C:\\Protech\\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++) { comboBoxRemoveUser.Items.Add(array[i].getUserName()); } }
private void comboBoxHomeHavingTroubleUserName_SelectedIndexChanged(object sender, EventArgs e) { string user; for (int i = 0; i < array.Count; i++) { user = array[i].getUserName(); try { if (user.Equals(comboBoxHomeHavingTroubleUserName.SelectedItem.ToString())) { labelHomeHavingTroubleQuestion.Text = array[i].getQuestion() + "? (Note answer is case sensitive)"; } } catch (Exception) { } } }
private void Form1_Load(object sender, EventArgs e) { pnlForgotPass.Visible = false; pnlPic.Visible = true; inputStream = File.OpenText("C:\\Protech\\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++) { comboBoxHomeUserNames.Items.Add(array[i].getUserName()); comboBoxHomeHavingTroubleUserName.Items.Add(array[i].getUserName()); } }