📄 register.aspx
字号:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Register.aspx.cs" Inherits="_Default" %>
<!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>
<link rel=stylesheet href="Styles/Style.css" type="text/css" />
<script type="text/javascript">
function CharMode(iN){
if (iN>=48 && iN <=57)
return 1;
if (iN>=65 && iN <=90)
return 2;
if (iN>=97 && iN <=122)
return 4;
else
return 8;
}
function bitTotal(num){
modes=0;
for (i=0;i<4;i++){
if (num & 1) modes++;
num>>>=1;
}
return modes;
}
function checkStrong(sPW){
if (sPW.length<=4)
return 0;
Modes=0;
for (i=0;i<sPW.length;i++){
Modes|=CharMode(sPW.charCodeAt(i));
}
return bitTotal(Modes);
}
function pwStrength(pwd){
O_color="#eeeeee";
L_color="#FF0000";
M_color="#FF9900";
H_color="#33CC00";
if (pwd==null||pwd==''){
Lcolor=Mcolor=Hcolor=O_color;
}
else{
S_level=checkStrong(pwd);
switch(S_level) {
case 0:
Lcolor=Mcolor=Hcolor=O_color;
case 1:
Lcolor=L_color;
Mcolor=Hcolor=O_color;
break;
case 2:
Lcolor=Mcolor=M_color;
Hcolor=O_color;
break;
default:
Lcolor=Mcolor=Hcolor=H_color;
}
}
document.getElementById("strength_L").style.background=Lcolor;
document.getElementById("strength_M").style.background=Mcolor;
document.getElementById("strength_H").style.background=Hcolor;
return;
}
</script>
</head>
<body background="image/bg.gif">
<form id="form1" runat="server">
<div>
<script language=javascript>+Window.setTimeout(\"location.href='Login.aspx'\",2000);+</script>
<table align=center border=1 bgcolor=white>
<tr>
<td colspan=2 align=center>
<h3>=注册新会员=</h3></td>
</tr>
<tr>
<td align=left colspan=2>注:带**号的内容为必填项,否则无法完成注册
</td>
</tr>
<tr>
<td style="width: 100px; height: 26px;">
登录名:</td>
<td style="width: 487px; height: 26px;">
<asp:TextBox ID="txtName" runat="server"></asp:TextBox>(**)<asp:RequiredFieldValidator
ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtName" ErrorMessage="此项不能为空" SetFocusOnError="True"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtName"
ErrorMessage="请检查输入的格式" ValidationExpression="\w{6,14}" SetFocusOnError="True"></asp:RegularExpressionValidator><br />
输入的登录必须是6-14位且属于(a-z),(A-Z),(0-9)中的任意字符</td>
</tr>
<tr>
<td align=right colspan=2>
<asp:Label ID="lblMessage" runat="server"></asp:Label>
<asp:Button ID="btnValidate" runat="server" Text="登录名是否被占用" OnClick="btnValidate_Click" CausesValidation="False" /></td>
</tr>
<tr>
<td style="width: 100px; height: 26px;">
登录密码:</td>
<td style="width: 487px; height: 26px;">
<asp:TextBox ID="txtPwd" runat="server" TextMode="Password" onkeyup="pwStrength(this.value)" onblur="pwStrength(this.value)"></asp:TextBox>(**)<asp:RequiredFieldValidator
ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtPwd" ErrorMessage="您不能输入空密码" SetFocusOnError="True"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtPwd"
ErrorMessage="请检查输入密码的长度" ValidationExpression="\S{6,12}" SetFocusOnError="True"></asp:RegularExpressionValidator><br />
请输入长度在6-12位之间的密码
<table border="1" cellspacing="0" cellpadding="1" style="background:#ccc;height:23px;width:217px">
<tr align="center" style=" background:#eeeeee">
<td style="width:50px; height: 22px;" id="strength_L">弱</td>
<td style="width:50px; height: 22px;" id="strength_M">中</td>
<td style="width:50px; height: 22px;" id="strength_H">强</td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="width: 100px">
确认密码:</td>
<td style="width: 487px">
<asp:TextBox ID="txtPwd2" runat="server" TextMode="Password" Width="149px"></asp:TextBox>(**)<asp:CompareValidator
ID="CompareValidator1" runat="server" ControlToCompare="txtPwd" ControlToValidate="txtPwd2"
ErrorMessage="请您再次输入口令" SetFocusOnError="True"></asp:CompareValidator></td>
</tr>
<tr>
<td style="width: 100px">
真实姓名:</td>
<td style="width: 487px">
<asp:TextBox ID="txtUname" runat="server"></asp:TextBox>(**)<asp:RequiredFieldValidator
ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtUname" ErrorMessage="请输入您的真实姓名"></asp:RequiredFieldValidator></td>
</tr>
<tr>
<td style="width: 100px; height: 49px;">
性别:</td>
<td style="width: 487px; height: 49px;">
<asp:RadioButtonList ID="rltSex" runat="server" RepeatDirection="Horizontal">
<asp:ListItem Selected="True">男</asp:ListItem>
<asp:ListItem>女</asp:ListItem>
</asp:RadioButtonList></td>
</tr>
<tr>
<td style="height: 21px" >
生日:</td>
<td style="height: 21px; width: 487px;">
<asp:DropDownList ID="ddlYear" runat="server">
</asp:DropDownList>年
<asp:DropDownList ID="ddlmonth" runat="server">
</asp:DropDownList>月
<asp:DropDownList ID="ddlDay" runat="server">
</asp:DropDownList>日</td>
</tr>
<tr>
<td style="height: 28px" >宅电:
</td>
<td style="width: 487px; height: 28px;">
<asp:TextBox ID="txtUtel2" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ControlToValidate="txtUtel2"
ErrorMessage="请输入7位或8位电话号码" ValidationExpression="(\(\d{3,4}\)|\d{3,4}-)?\d{7,8}"></asp:RegularExpressionValidator></td>
</tr>
<tr>
<td style="width: 100px">
移动电话:</td>
<td style="width: 487px">
<asp:TextBox ID="txtUtel3" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" ControlToValidate="txtUtel3"
ErrorMessage="请输入11位手机号码" ValidationExpression="\d{11}"></asp:RegularExpressionValidator></td>
</tr>
<tr>
<td style="width: 100px">
通讯地址:</td>
<td style="width: 487px">
<asp:TextBox ID="txtUaddr" runat="server" Width="425px"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 100px">
邮政编码:</td>
<td style="width: 487px">
<asp:TextBox ID="txtUzip" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server" ControlToValidate="txtUzip"
ErrorMessage="请输入六位邮政编码" ValidationExpression="\d{6}"></asp:RegularExpressionValidator></td>
</tr>
<tr>
<td style="width: 100px">
E_mail:</td>
<td style="width: 487px">
<asp:TextBox ID="txtUemail" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator6" runat="server" ControlToValidate="txtUemail"
ErrorMessage="请输入正确E_mail地址" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator></td>
</tr>
<tr>
<td style="width: 100px">
QQ:</td>
<td style="width: 487px">
<asp:TextBox ID="txtUQQ" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td colspan=2 align=center>
<asp:Button ID="btnSubmit" runat="server" Text="注册" OnClick="btnSubmit_Click" />
<asp:Label ID="lblshow" runat="server"></asp:Label></td>
</tr>
</table>
</div>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -