[英]using asp.net membership provider how to check if the user is registered or not?
using asp.net and c# membership provider how to check if the user is registered or not? 使用asp.net和c#membership provider如何检查用户是否注册? I want to handle this in code not by using "login status"? 我想在代码中处理这个而不是使用“登录状态”?
Not sure if you want to know if they are a "registered" user or have logged in (as the Login status would indicate) 不确定您是否想知道他们是“已注册”用户还是已登录(如登录状态所示)
Here's to know if they are logged in (what the Login status uses): 这是要知道他们是否已登录(登录状态使用的内容):
System.Web.HttpContext.Current.User.Identity.IsAuthenticated;
MembershipProvider.GetUser(string username, bool updateLastActivityDateTime)
这将获取用户,或返回用户不存在的null(尚未注册)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.