简体   繁体   中英

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? 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(尚未注册)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM