📄 login.asp
字号:
<%@ Language=VBScript %>
<!--#include file="conn.asp"-->
<%
'判断用户是否提交表单
if isempty(Request.Form("Login")) then
Session.abandon
Session("NumAttempts") = 1
TheMessage = "登录系统"
'校验用户提交的登录信息
else
TheUsername=Request.Form("Username")
ThePassword=Request.Form("Password")
'<2> 连接数据库进行身份验证
If Instr(TheUsername, "'")=0 and Instr(ThePassword, "'")=0 and Instr(TheUsername, "'")=0 _
and Instr(ThePassword, "'")=0 then
set RSLogin = conn.Execute("select * from Userinfo where " & "LoginID = '" _
& TheUsername & "' and " & "Password = '" & ThePassword & "'")
'<3> 登录失败处理
if RSLogin.EOF then
Session("NumAttempts") = Session("NumAttempts") + 1
if Application("NumAttempts") = 0 then
TheMessage = "登录不成功,请重试:"
elseif Session("NumAttempts") > Application("NumAttempts") then
TheMessage = "登录不成功,登录次数已满,无法重试"
else
TheTimes=Application("NumAttempts")-Session("NumAttempts")+1
TheMessage = "登录不成功,还有" & TheTimes & "次机会,请重试:"
end if
else
'登录成功
Session("ID") = RSLogin("LoginID")
Application("ID") = RSLogin("LoginID")
Session("Name") = RSLogin("Name")
Session("Password") = RSLogin("Password")
Session("Department") = RSLogin("Department")
Session("EmailAddress")=RSLogin("EmailAddress")
Session("Position")=RSLogin("Position")
Session("InternalPhone")=RSLogin("InternalPhone")
Session("HomePhone")=RSLogin("HomePhone")
Session("MobilePhone")=RSLogin("MobilePhone")
Session("QQ")=RSLogin("QQ")
Session("Birthday")=RSLogin("Birthday")
Session("HomeAddress")=RSLogin("HomeAddress")
Session("IsSystemManager")=RSLogin("IsSystemManager")
Session("IsFinancialManager")=RSLogin("IsFinancialManager")
Response.Redirect "html/home.asp"
end if
else
TheMessage="用户名或者密码输入不合格式"
end if
end if
%>
<html>
<head>
<title> 系统登录</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#000066">
<table width="800" border="0" bordercolor="#16A84D" align="center" cellpadding="0" cellspacing="0">
</table>
<table width=500 border="0" align=center bgcolor=#0099FF height=183>
<tr bgcolor=white>
<td align=middle bgcolor=#FFFFCC class=itm height="179" colspan="2"><% response.write TheMessage %><div align="center">
<%
if TheMessage <> "登录失败,登录次数已满,无法继续尝试" then
%>
<form name="form" method="post" action="login.asp">
<p><font color="#BB3466" size="1">用户</font>
<font size="1">
<input class=itm name=UserName size=15>
</font>
<p><font color="#BB3466" size="1">口令</font>
<font size="1">
<input class=itm name=Password size=15 type=password>
</font><font size="2"><br>
</font><br>
<input type="submit" name="Login" value="登录">
<input type="reset" name="Reset" value="重设">
</form>
<%
end if
%>
</div></td>
</tr>
</table>
<p align="center"> </p>
<p align="center"><font color="#FFFFFF" size="4"><strong>企业办公自动化系统 技术支持QQ:371972484</strong></font></p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -