-2
我的公司希望讓我重新設計他們的服務軟件。我正在查看一些舊代碼。它看起來像VB和HTML的組合。是對的嗎?他們使用的服務器有幾個訪問數據庫。 Idk有關訪問的任何信息。這些命令看起來與SQL非常類似,除了標識符的括號外。這裏可能是rudamentary信息。我計劃將其重寫爲Visual Studio中的公共應用程序。ASP登錄頁面內容
<%
msgTxt = Request("msgTxt")
If Request("Action") = "Log on" Then
sql = "SELECT [ID], [Password]"
sql = sql & " FROM [tbl Employees]"
sql = sql & " WHERE [ID] = '" & Request("EmpID") & "' AND [Password] = '" & Request("Password") & "'"
sql = sql & ";"
Set rs_logon = Session("Conn").execute(sql)
On Error Resume Next
empId = rs_logon("ID")
If empId <> "" AND Err.Number = 0 Then
On Error Goto 0
Session("svEmp") = empId
SQL = "SELECT [ID] FROM [tbl Employees] WHERE [ID] = '" & Session("svEmp") & "';"
set rs_emp = Session("Conn").Execute(SQL)
Session("svEmp") = rs_emp("ID")
Session("lastCompanyViewed") = "0"
SQL = "UPDATE DISTINCTROW [tbl Employees] SET "
SQL = SQL & "[Online] = True "
SQL = SQL & "WHERE [ID]='" & Session("svEmp") & "';"
Session("Conn").Execute(SQL)
redirTo = "default.asp"
If Request("referrer") <> "" Then
redirTo = Request("referrer")
End If
Response.Redirect redirTo
Else
msgTxt = "Sorry. That set of credentials is invalid."
Session("svEmp") = ""
End If
End If
If Request("Action") = "Log off" Then
SQL = "UPDATE DISTINCTROW [tbl Employees] SET "
SQL = SQL & "[Online] = False "
SQL = SQL & "WHERE [ID]='" & Session("svEmp") & "';"
Session("Conn").Execute(SQL)
Session("svEmp") = ""
redirTo = "logon.asp"
Response.Redirect redirTo
End If
%>
<html>
<head>
<link rel="stylesheet" type="text/css" href="cogs.css" />
<title>Log on</title>
</head>
<body background="" onload="javascript:if(document.all.EmpID.value==''){document.all.EmpID.focus();}">
<table border="0" cellpadding="0" cellspacing="0" align="center">
<tr style="height:28px;">
<td style="height:28px;width:28px;background:url('images/blue_top_left.jpg');"></td>
<td style="height:28px;background:url('images/blue_top.jpg');"></td>
<td style="height:28px;width:28px;background:url('images/blue_top_right.jpg');"></td>
</tr>
<tr>
<td style="width:28px;background:url('images/blue_left.jpg');"></td>
<td style="background-color:2C9FF0;" align="center">
<div align="center"><img src="images/rt_logo.gif"></div>
<br>
<%=msgTxt%>
<form method="post">
<div>Identification:</div>
<input type="text" name="EmpID">
<div>Password:</div>
<input type="password" name="Password">
<br><br>
<br>
<input type="submit" class="button" name="Action" value="Log on" class="button">
</form>
<br>
<div align="center"><img src="images/cogs_logo.gif"></div>
<div>© <%=DatePart("yyyy",Date())%> ---------------------------, Inc.</div>
</td>
<td style="width:28px;background:url('images/blue_right.jpg');"></td>
<tr>
<tr style="height:28px;">
<td style="height:28px;width:28px;background:url('images/blue_bottom_left.jpg');"></td>
<td style="height:28px;background:url('images/blue_bottom.jpg');"></td>
<td style="height:28px;width:28px;background:url('images/blue_bottom_right.jpg');"></td>
</tr>
<tr>
<td colspan="3" align="center">
</td>
</tr>
</table>
<div align="center">
<div><strong>This site is for the sole use of ------------ and its employees. All other use is strictly prohibited.</strong></div>
</div>
<%=Session("svEmp")%>
</body>
</html>
您有任何具體問題嗎? – Andrei
**它看起來像VB和HTML的組合。是對的嗎?** – Flibertyjibbet