⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 resetpwd.aspx

📁 用asp写的程序,在线考试系统,功能齐全,是一个非常好用的系统
💻 ASPX
字号:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="resetpwd.aspx.cs" Inherits="Students_resetpwd" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>密码修改窗口</title>
<script type="text/javascript">
function closeWin()
{
    window.close();
}

function repwd()
{
//debugger;
    var tbUser = document.getElementById("tbUser").value;
    var tbOldPwd = document.getElementById("tbOldPwd").value;
    var tbNewPwd = document.getElementById("tbNewPwd").value;
    var tbReNewPwd = document.getElementById("tbReNewPwd").value;
    var strmatch = /^[a-zA-Z0-9]{6,20}$/;
    var matchNewPwd = tbNewPwd.match(strmatch);
    
    //------------------------------------
    //准确性判断
    if(tbUser == ''|| tbOldPwd == ''|| tbNewPwd == ''|| tbReNewPwd == '')
    {
        window.alert("输入框不为空!");
        return false;
    }
    
    if(tbNewPwd != tbReNewPwd)
    {
        window.alert("两次输入新密码不一致!");
        return false;
    }
    
    if(matchNewPwd == null)
    {
        window.alert("密码由【6-20】个数字或者字母组成!");
        document.getElementById("tbNewPwd").value = '';
        document.getElementById("tbReNewPwd").value = '';
        document.getElementById("tbNewPwd").focus();
        return false;
    }
    
    //--------------------------------------------
    //调用服务器端的asmx
    ExamOnline.WSRePwd.repwd(tbUser,tbOldPwd,tbNewPwd,SucceededRePwd);
}

function SucceededRePwd(result)
{
    if(result)
    {
        window.alert("密码修改成功!");
        window.close();
    }
    else
    {
        window.alert("原密码输入错误!");
        return false;
    }
}
</script>
</head>
<body style="text-align:center;">
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        <Services>
            <asp:ServiceReference Path="WSRePwd.asmx" />
        </Services>
        </asp:ScriptManager>
        <table style="border-right: buttonface thin solid; border-top: buttonface thin solid; border-left: buttonface thin solid; border-bottom: buttonface thin solid">
            <tr>
                <td colspan="2">
                    <asp:Label ID="Label1" runat="server" Text="密码修改"></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="lblUser" runat="server" Text="用户名:"></asp:Label>
                </td>
                <td width="100px">
                    <input id="tbUser" type="text" />
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="lblOldPwd" runat="server" Text="原密码:"></asp:Label>
                </td>
                <td width="100px">
                    <input id="tbOldPwd" type="password" style="width: 150px" />
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="lblNewPwd" runat="server" Text="新密码:"></asp:Label>
                </td>
                <td width="100px">
                    <input id="tbNewPwd" type="password" style="width: 150px" />
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="lblReNewPwd" runat="server" Text="新密码:"></asp:Label>
                </td>
                <td width="100px">
                    <input id="tbReNewPwd" type="password" style="width: 150px" />
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <input id="btnSubmit" type="button" value="确定" onclick="repwd()" />
                    <input id="btnClose" type="button" value="关闭" onclick="closeWin()" /></td>
            </tr>
        </table>
    </form>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -