是否有 Membership.ValidateUser() 替代方案仅检查用户名密码组合?
是否有 Membership.ValidateUser 替代方案仅检查用户名密码组合?换句话说,有没有办法可以告诉我用户名和密码是正确的,但用户无效?在实施注册确认电子邮件时,它可能会很方便。
Is there a Membership.ValidateUser alternative that only checks username password combo? In other words, is there a way I can tell that the username and password are correct but the user is not valid? It may come handy when implementing confirmation email for registrations.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,
只需在用户数据存储中进行查找即可。
例如。
编辑:
对于我使用的加密密码和 MD5 哈希。所以这个帮助器类可能会有所帮助
,您可能会为您的测试方法执行类似的操作,
我还没有编译或测试它,但它应该为您提供您所追求的要点。
Yes,
simply do a lookup in the user datastore.
eg.
EDIT:
for the encrypted password I use and MD5 Hash. so this helper class might be helpful
and you might do something like this for your test method
I haven't compiled or tested this but it should give you the gist of what you are after.