?? chklogin.asp
字號(hào):
<%@ Language=VBScript %>
<!--#include file="data.asp"-->
<%
set rs=server.CreateObject ("adodb.recordset")
'將rs的參數(shù)設(shè)定為由Server執(zhí)行CreateObject的操作,并且產(chǎn)生ADODB中的Recordset對(duì)象
rs.Open"select * from student where 學(xué)號(hào)="+"'"+request.form("classno")+"'",conn,1
'將rs的參數(shù)設(shè)定為執(zhí)行SQL的查詢語(yǔ)法,將'含有"default.asp"中輸入的學(xué)號(hào)的記錄作為查詢對(duì)象
recordcount=rs.RecordCount
'對(duì)查詢對(duì)象進(jìn)行計(jì)數(shù)
if recordcount<>0 then
'如果查詢對(duì)象計(jì)數(shù)大于0則顯示該記錄的如下信息
session("姓名")=rs("姓名")
session("學(xué)號(hào)")=rs("學(xué)號(hào)")
session("班級(jí)")=rs("班級(jí)")
%>
<title>個(gè)人信息</title>
<div align="center">
<p> </p>
<form name="form1" method="post" action="test.asp">
<div align="center"><font size="5"><b>請(qǐng)檢查下面關(guān)于你的信息對(duì)嗎?</b></font><br>
<br>
</div>
<table border="1" cellspacing="2" align="center" width="28%">
<tr>
<td width="32%" nowrap><b><font size="4">學(xué) 號(hào):</font></b></td>
<td width="68%" nowrap><b><font size="4"><%=session("學(xué)號(hào)")%>
</font></b></td>
</tr>
<tr>
<td width="32%" nowrap><b><font size="4">姓 名:</font></b></td>
<td width="68%" nowrap><b><font size="4"><%=session("姓名")%></font></b></td>
</tr>
<tr>
<td width="32%" nowrap><b><font size="4">班 級(jí):</font></b></td>
<td width="68%" nowrap><b><font size="4"><%=session("班級(jí)")%></font></b></td>
</tr>
</table>
<br>
<input type="submit" name="Submit" value="進(jìn) 入 考 試" >
</form>
</div>
<%
else
'如果沒(méi)有查到該學(xué)號(hào),則提示
response.write "學(xué)號(hào)輸入有誤!"+"<br>"
end if
%>
<div align="center"><br>
<a href="default.asp">返回登錄頁(yè)面</a></div>
<%
rs.Close
'關(guān)閉rs對(duì)象
conn.close
'關(guān)閉conn對(duì)象
set rs=nothing
'斷開與查詢對(duì)象的鏈接
set conn=nothing
'斷開與數(shù)據(jù)庫(kù)的鏈接
%>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -