コード例 #1
0
        public void OnPost()
        {
            string username = Request.Form["username"];
            string password = Request.Form["password"];
            User   user     = store.getUser(username);

            if (user != null)
            {
                store.user    = user.fullname;
                store.message = user.fullname + ": Welcome back !";
            }
            else
            {
                store.message = "Username/password not found";
            }
        }
コード例 #2
0
        public void OnPost()
        {
            User user = new User {
                fullname = Request.Form["fullname"],
                username = Request.Form["username"],
                password = Request.Form["password"]
            };

            if (store.getUser(user.username) == null)
            {
                store.registerUser(user);
                store.message = "New user registered: " + user.fullname;
            }
            else
            {
                store.message = "Username unavailable";
            }
        }