Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 asp.net 和 c# 会员提供程序如何检查用户是否已注册?我想在代码中处理这个而不是使用“登录状态”?
不确定您是否想知道他们是“注册”用户还是已登录(如登录状态所示)
这是要知道他们是否已登录(登录状态使用什么):
System.Web.HttpContext.Current.User.Identity.IsAuthenticated;
MembershipProvider.GetUser(string username, bool updateLastActivityDateTime)
这将获取您的用户,或者返回null的用户不存在(尚未注册)