Beispiel #1
0
        protected void FtpAccount_Login(object sender, EventArgs e)
        {
            string username = UserName.Text;
            string password = Password.Text;

            var accountManager = new AccountManager();
            bool loginSuccess = accountManager.CertificateAccount(username, password);
            if (!loginSuccess)
            {
                FailureText.Text = "登录失败,请确保用户名和密码输入正确";
                return;
            }

            FormsAuthentication.SetAuthCookie(username, false /* createPersistentCookie */);
            Response.Redirect("~/");
        }