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.
我正在使用表单身份验证和成员资格提供程序。当我调用 Membership.ValidateUser(logon.UserName,logon.Password) 时,它只返回一个布尔值,指示该用户是否有效。但我希望用户被退回。我怎样才能做到这一点?
string userName = "someuser"; string password = ""; MembershipUser user = null; if (Membership.ValidateUser(userName,password)) { user = Membership.GetUser(userName); }