我正在使用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发布于 2010-07-06 04:53:28
如果验证结果确实是正确的,那么您可以使用SetAuthCookie。
https://stackoverflow.com/questions/3182089
复制相似问题