Ejemplo n.º 1
0
        public ActionResult RegNewUser(FormCollection form)
        {
            string username = form["name"];
            string password = form["password"];
            string ConPw    = form["Confirmpassword"];
            string EM       = form["Emailaddress"];



            if (CheckUserName(username))
            {
                return(RedirectToAction("Regfail", "Register"));
            }
            else
            {
                int    hashedpassword = passwordhashing(password);
                string pw             = hashedpassword.ToString();
                UserData.AddNewUser(username, pw, pw, EM);

                return(RedirectToAction("RegSuc", "Register"));
            }
        }
Ejemplo n.º 2
0
        public ActionResult RegNewUser(FormCollection form)
        {
            string username = form["Name"];
            string password = form["Password"];
            string ConPw    = form["Confirm_password"];
            string EM       = form["EmailAdd"];



            if (CheckUserName(username))
            {
                return(RedirectToAction("Regfail", "Home"));
            }
            else
            {
                using (MD5 md5Hash = MD5.Create())
                {
                    string hashedpassword = GetMd5Hash(md5Hash, password);

                    UserData.AddNewUser(username, hashedpassword, hashedpassword, EM);
                }
                return(RedirectToAction("RegSuc", "Home"));
            }
        }