ASP.Net 成员资格验证手动创建的用户
我使用membership.creatuser() 在我的asp.net 用户表中手动创建用户。 有没有一种简单的方法来测试以确保帐户已创建并且/或在创建后有效?
MembershipCreateStatus status = new MembershipCreateStatus();
Membership.CreateUser(user.FirstName + user.LastName,
user.Password, user.Email);
我基本上想自动登录该网站,然后返回是否成功?
任何链接或想法将不胜感激。
谢谢
I am manually creating users in my asp.net user tables with the membership.creatuser(). Is there an easy way to test to make sure the account is created and or valid after I create it?
MembershipCreateStatus status = new MembershipCreateStatus();
Membership.CreateUser(user.FirstName + user.LastName,
user.Password, user.Email);
I would basically like to do an auto sign in to the site and then return if it was successful or not?
Any links or ideas would be greatly appreciated.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
嗯,
CreateUser()
方法有一个out
参数,它将返回一个MembershipCreateStatus
enum
,其中包含有关发生的情况的详细信息。 该enum
中除Success
之外的任何内容都表明存在潜在问题。我看到您已经声明了
status
变量,您只需要使用它即可!Well, the
CreateUser()
method has anout
parameter that will return aMembershipCreateStatus
enum
with details about what happened. Anything other thanSuccess
from thatenum
indicates a potential problem.I see you've declared your
status
variable, you just need to use it!