在C#中的密码恢复工具不工作 [英] Password Recovery tool in C# not working

查看:104
本文介绍了在C#中的密码恢复工具不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

喜(我pretty新本),

Hi (I'm pretty new to this),

我创建了一个门户,并在该用户登录,他们可以查看我所做的其他程序。问题是密码恢复似乎并不奏效 - 我们无法访问您的信息,请再试一次。我没有得到任何错误信息,我只是得到的消息
我有正确的ASP.NET配置设置,并用不同的用户和权限进行测试,但我只是想知道如果有什么我需要在configuartion经理或web.config中这样做,这是可行的。

I have created a portal where the user logs in and within that, they can view other programs I've made. The problem is the password recovery does not seem to be working - I get no error messages, I just get the message "We were unable to access your information. Please try again." I have the ASP.NET configuration setup correctly and have tested this with different users and permissions but I was just wondering if there is something I need to do in the configuartion manager or the web.config so that this can work.

下面是code的密码恢复工具:

Below is the code for the password recovery tool:

<form id="form1" runat="server">
<div align="center">
    <asp:PasswordRecovery ID="PasswordRecovery1" runat="server" Height="147px" Width="442px" BackColor="#F7F6F3" BorderColor="#E6E2D8" BorderPadding="4" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em">
        <UserNameTemplate>
            <table border="0" cellpadding="1" cellspacing="0" style="border-collapse: collapse">
                <tr>
                    <td style="width: 445px">
                        <table border="0" cellpadding="0" style="width: 442px; height: 147px">
                            <tr>
                                <td align="center" colspan="2">
                                    <strong><span style="font-size: 0.9em">Password Recovery</span></strong></td>
                            </tr>
                            <tr>
                                <td align="center" colspan="2">
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td align="right">
                                    <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">Username:</asp:Label></td>
                                <td style="width: 291px">
                                    <asp:TextBox ID="UserName" runat="server" Width="187px"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
                                        ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="PasswordRecovery1">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="center" colspan="2" style="color: red">
                                    <asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal>
                                </td>
                            </tr>
                            <tr>
                                <td align="right" colspan="2" style="text-align: right">
                                    <asp:Button ID="SubmitButton" runat="server" CommandName="Submit" Text="Submit" ValidationGroup="PasswordRecovery1"
                                        Width="103px" />
                                    &nbsp; &nbsp;
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </UserNameTemplate>
        <InstructionTextStyle Font-Italic="True" ForeColor="Black" />
        <SuccessTextStyle Font-Bold="True" ForeColor="#5D7B9D" />
        <TextBoxStyle Font-Size="0.8em" />
        <TitleTextStyle BackColor="#5D7B9D" Font-Bold="True" Font-Size="0.9em" ForeColor="White" />
        <SubmitButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid"
            BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em" ForeColor="#284775" />
    </asp:PasswordRecovery>
</div>
</form>

感谢您。

推荐答案

看起来我的权利。
检查你的webconfig,以确保您的会员提供者

Looks right to me. Check your webconfig to make sure your membership provider has


  • enablePasswordRetrieval =FALSE

  • enablePasswordReset设置=真正的

  • requiresQuestionAndAnswer =FALSE

此外,你需要设置邮件定义你的web.config的控制,能够邮寄新的密码。

Also you need to set up a mail definition in your web.config for the control to be able to mail the new password.

<mailSettings>
  <smtp from="from@from.com">
    <network host="your.smtp.server" port="25"/>
  </smtp>
</mailSettings>

这篇关于在C#中的密码恢复工具不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆