?? login.asp
字號:
<%@ Language=VBScript %>
<%
'判斷用戶是否提交表單
if isempty(Request.Form("Login")) then
Session.abandon
Session("NumAttempts") = 1
TheMessage = "請在下面登錄:(缺省管理員用戶名:1,密碼:1)"
'校驗用戶提交的用戶信息
else
set conn = server.createobject ("adodb.connection")
conn.open "ASPData", "sa", "yourpassword"
TheUsername=Request.Form("Username")
ThePassword=Request.Form("Password")
If Instr(TheUsername, "'")=0 and Instr(ThePassword, "'")=0 and Instr(TheUsername, "'")=0 _
and Instr(ThePassword, "'")=0 then
set RSLogin = conn.Execute("select * from PSLogins where " & "LoginID = '" _
& TheUsername & "' and " & "Password = '" & ThePassword & "'")
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>
<table width=800 border=0 align=center cellpadding=2 cellspacing=1 bordercolor="#996633" bgcolor=#164DA8>
<tr bgcolor=white>
<td valign=center bgcolor="#0066CC" >
<div align="center"><font color="#CCCCCC" size="+7" face="華文隸書"><strong>公司內部辦公信息管理系統</strong></font></div></td>
</tr>
</table>
<table width="800" border="0" bordercolor="#164DA8" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="13"> </td>
</tr>
</table>
<table width=800 border=0 bgcolor=#164DA8 cellspacing=1 cellpadding=2 align=center>
<tr>
<td height="23" colspan=3> <font color=white>
<P ALIGN="CENTER"><font size="2">公司內部辦公信息管理系統->登錄頁面</font></font></td></tr>
<tr bgcolor=white >
<td><a href=".././html/home.asp"><font color="#104DAD" size="2">返回上一站點</font></a></td>
<td align=center> <font color="#104DAD" size="2" ><% response.write TheMessage %></FONT></td>
<td align=right><a href="Login.asp"><font color="#104DAD" size="2">系統使用說明</font></a></td>
</tr>
</table>
<table width="800" border="0" bordercolor="#164DA8" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="13"> </td>
</tr>
</table>
<br>
<table width=800 border="0" align=center bgcolor=#3466BB height=350>
<tr bgcolor=white>
<td align=middle bgcolor=#B6CAEB class=itm height="8" colspan="2">
<br> <% response.write TheMessage %>
<div align="center">
<%
if TheMessage <> "登錄不成功,登錄次數已滿,無法重試" then
%>
<form name="form" method="post" action="login.asp">
<p><font color="#3466BB">用戶</font>
<input class=itm name=UserName size=15>
</p>
<p><font color="#3466BB">密碼</font>
<input class=itm name=Password size=15 type=password>
<br>
<br>
<input type="submit" name="Login" value="登錄" style="border: 1px solid #B6CAEB; background-color: #3466BB; color: #FFFFFF">
<input type="reset" name="Reset" value="重設" style="border: 1px solid #B6CAEB; background-color: #3466BB; color: #FFFFFF">
</p>
</form>
<%
end if
%>
</div></td>
</tr>
</table>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -