我正在使用CreateUserWizard
注册用户。控件的内置逻辑正在完成添加用户的所有工作。但是在注册时,我希望用户被认为是“经过身份验证的”。我认为Authenticate
函数会对我进行身份验证,但该函数会将Authenticated
布尔值设置为False。但请注意,ValidateUser
函数返回True。
如何在注册后自动登录/验证使用,这样他只需在注册新凭据后就不必“登录”了?
Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As Object,
ByVal e As System.EventArgs) Handles CreateUserWizard1.CreatedUser
Dim Authenticated As Boolean =
FormsAuthentication.Authenticate(CreateUserWizard1.UserName,
CreateUserWizard1.Password)
Dim Validated As Boolean = Membership.ValidateUser(CreateUserWizard1.UserName,
CreateUserWizard1.Password)
End Sub
答案 0 :(得分:1)
如果验证确实证明是正确的,那么您可以使用SetAuthCookie。