public static string RetrieveUserInfo(string name, string secret) { string message = ""; string personalInfo = UserDetailsReader.ReadFile(name); if (personalInfo.Equals("FAIL")) { message = "The username you entered, doesn't exist"; } else { string[] data = personalInfo.Split(' '); string password = PasswordClean(data[0]); string phrase = SecretClean(data[4]); if (IsCorrect(phrase)) { message = "Thank you for your patience, " + name + " your password is : " + password; } else { message = "Incorrect secret phrase...... hmmmm..... are you really " + name + " ?"; } } return(message); }
public static string RetrieveUserQuestion(string name) { string question = ""; string personalInfo = UserDetailsReader.ReadFile(name); if (personalInfo.Equals("FAIL")) { MessageBox.Show("The username you entered, doesn't exist"); } else { string[] data = personalInfo.Split(' '); question = QuestionClean(data[3]); } return(question); }