Example #1
0
        public void saveRecovery(string the_question, string username, string recovery_answer)
        {
            var    file_handler  = new MyFileHandler(username);
            string question_path = "./account_list/" + username + "/recovery_question.txt";

            file_handler.WriteToFile(question_path, the_question);

            string answer_path = "./account_list/" + username + "/recovery_answer.txt";

            file_handler.WriteToFile(answer_path, recovery_answer);
        }
Example #2
0
        public void savePassword(string username, string password)
        {
            var    file_handler = new MyFileHandler(username);
            string path         = "./account_list/" + username + "/key.txt";

            file_handler.WriteToFile(path, password);
        }
Example #3
0
        public bool checkUser(string _password, string _username)
        {
            MyFileHandler file_handler  = new MyFileHandler(_username);
            string        username_path = "./account_list/" + _username;

            if (file_handler.CheckDirectory(username_path))
            {
                string   password_path    = "./account_list/" + _username + "/key.txt";
                string[] fetched_password = File.ReadAllLines(password_path);

                if (_password == fetched_password[0])
                {
                    Console.Clear();

                    //Console.WriteLine("Log in Successfully! ");
                    //Console.ReadLine();
                    //Console.Clear();

                    file_handler.WriteToFile("./account_list./active_user.txt", _username);
                    return(false);
                }
                else
                {
                    error_message("password");
                    return(true);
                }
            }
            else
            {
                error_message("username");
                return(true);
            }
        }