示例#1
0
        public string Validate()
        {
            string message      = "";
            string personalInfo = UserDetailsHandler.ReadUserDetails(Name);

            //personal if is matched as Password:<password>(space)AccessToken:<accessToken>(space)Secret:<secret>
            if (personalInfo.Equals("FAIL"))
            {
                message = "The username you entered, doesn't exist";
            }
            else
            {
                string[] data = personalInfo.Split(';');

                string password = PasswordClean(data[0]);
                SetAccessToken(data[1]);
                if (Password.Equals(password))
                {
                    message = "Welcome, " + Name;
                }
                else
                {
                    message = "Incorrect password";
                }
            }
            return(message);
        }
示例#2
0
        public static string RetrievePersonalInfo()
        {
            string personalInfo = UserDetailsHandler.ReadUserDetails(Name);

            if (personalInfo.Equals("FAIL"))
            {
                ShowDialog();
                personalInfo = "";
            }

            return(personalInfo);
        }