在asp.net中手动激活用户帐户

发布于 2024-09-07 06:06:33 字数 155 浏览 3 评论 0原文

我有一个(很难合作的)客户在我们的网站上创建了一个帐户,但是,他无法登录,因为他尚未单击帐户激活链接。出于某种原因,他不想单击它(他认为它是病毒),

无论如何,我想手动将帐户设置为通过数据库激活..我该怎么做? 谢谢!

(我的意思是,哪些字段需要更改为哪些值?)

I have a (difficult to work with) client who has created an account in our website, however, he cannot log in because he hasnt clicked the account activation link yet. for some reason, he doesnt want to click it (he thinks its virus)

anyway, I want to manually set the account to activated via database.. how do I do that?
thanks!

( i mean, which fields needs to be changed to what values?)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

满天都是小星星 2024-09-14 06:06:33

在您的 MembershipProvider 上调用这两个方法。

        Membership.GetUser().UnlockUser();
        Membership.GetUser().IsApproved = true;

call these two methods on your MembershipProvider.

        Membership.GetUser().UnlockUser();
        Membership.GetUser().IsApproved = true;
离笑几人歌 2024-09-14 06:06:33

我在 aspnet 会员表中做了一些摆弄,并找到了如何手动激活帐户!

update aspnetdb.dbo.aspnet_Membership set IsApproved = 1 where UserId = (select UserId From aspnetdb.dbo.aspnet_Users where UserName = @Username)

用户 ID 长得离谱,所以我发现从用户表中的用户名中获取它更容易。

I did some fiddeling around the aspnet membership table and found out how to activate the account manually!

update aspnetdb.dbo.aspnet_Membership set IsApproved = 1 where UserId = (select UserId From aspnetdb.dbo.aspnet_Users where UserName = @Username)

the userid is ridiculously long so i found it easier to pick it up from username from users table.

2024-09-14 06:06:33

我最近遇到了同样的问题,我发现当您执行 Membership.CreateUser 调用时,您可以通过像这样插入它来自动将用户创建为 true:

Membership.CreateUser(userName, Password, eMail, passwordQuestion, passwordAnswer, isApproved)

isApproved< /code> 是一个 bool,可以在调用创建用户时设置为 true。

I had the same problem recently and I found that when you are doing the Membership.CreateUser call you can make it that the user is automatically created as true by inserting it like this:

Membership.CreateUser(userName, Password, eMail, passwordQuestion, passwordAnswer, isApproved)

The isApproved is a bool and can be set as true when you call the create user.

岁月蹉跎了容颜 2024-09-14 06:06:33

不能临时将自己的地址分配给该帐户并重新发送激活网址吗?也许他可以将邮件转发给您,您可以单击链接。认为这比“侵入”会员服务提供商更容易。

另外,称你的客户愚蠢也不是处理客户的好方法;)

Can't you temporary assign your own address to the account and resend the activation url? Maybe he can forward you the mail and you can click the link. Think that is easier than "hacking" your way into the membership provider.

Also calling your client dumb is not a very good way to handle your clients ;)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文