试题四(共15分)
阅读以下说明,回答问题1至问题4,将解答填入答题纸对应的解答栏内。
某管理系统中的用户密码修改界面如图4-1。
【问题2】(每空1分)
以下是该管理系统密码更改的部分changepassword.asp代码,请将(8)〜(15) 的空缺代码补充完整。
<html>
<body bgcolor=#c1f7d8>
<center>
<%
dim stroldpassword,strnewpassword,strconfirmpassword
dim strwhere,strsql,strdsn,strchangesql
stroldpassword=(8).form("oldpassword")
strnewpassword=request.form("newpassword")
strconfirmpassword=request.form("(9)")
if stroldpassword="" or strnewpassword="" then
(10).write "请输入密码"
response.end
end if
if strnewpassword<>strconfirmpassword then
response.write "两次密码不相同"
response.(11)
end if
strwhere="where username='" & session("name") & "' and userpassword='" & stroldpassword & "'"
strsql="(12) * from user " & strwhere
strdsn="dsn=bbs;uid=feng;pwd=feng"
strchangesql="update user set userpassword ='" & strnewpassword & "' " & strwhere
set rs=(13).createobject("adodb.recordset")
rs.(14) strsql,strdsn,1,3
%>
<br>
<%
if rs.recordcount=1 then
set changers=server.createobject("adodb.recordset")
changers.open strchangesql,strdsn,1,3
set changers=nothing
response.write "密码已成功修改"
else
response.write "密码输入错误,无法修改密码"
end if
rs.(15)
set rs=nothing
%>
</body>
</html>(8)~(13)备选答案:
A.responseB.selectC.requestD.close
E.confirmpasswordF.serverG.end H.open