假设连接的数据记录集当前指向的记录如下:
写出以下ASP代码经过IIS服务器解释后的结果。
<td align-"center" width="20%"><a href="<%=rs("Type")%>.asp"><font size="2"><%=rs("Type")%>
</font></a>
第1题:
请根据图6-15网页的显示效果,将ASP程序中(2)、(5)、(7)、(8)、(9)空缺处的代码补充完整。
供选择的答案:
A.Trim(request("item")) B.rs item.movenext
C.rs.movenext D.<!--include file="conn.asp"-->
E.select*from data where item="&item_type&"
F.<td width="43"height="30"align="center"><%=rs("Brand")%></td>
G.<td width="43"height="30"align="center"><%=rs("hits")%></td>
第2题:
请根据网页显示的效果图和网页中的元素说明,将HTML文本中(n)处的解答填写入解答栏内。
【说明】
“文学世界”网页的效果如图4-1所示。其中网页的背景音乐为当前路径下的love.mp3。
[程序源代码]
<HTML>
<HEAD>
<TITLE>文学世界</TITLE>
< (1) src="love.mp3">
</HEAD>
<BODY>
<P align="center"><FONT size="6"> 文学世界</FONT></P>
(2)
<% LOCK Application("counter")=Application("counter")+1
(3) %>
<P align="center">欢迎您的到来!您是本站的第(4)位贵宾
<TABLE border="1">
<TR>
<TD rowspan= (5) align="center">
<IMG border="0" scr="literature.gif">
<TD align="center" width="21%">首页
<TD align="center" width="25%">体育世界
<TD align="center" width="24%">旅游天地
<TR>
<TD align="center" width="21%">休闲娱乐
<TD align="center" width="25%">时尚感觉
<TD align="center" width="24%">视频天地
<TR>
<TD width="27%" valign="top">
<OL>
<LI> 小说
<UL (6) >
<LI><A href="流年">流年</A>
<LI>孤独的树
</UL>
<LI>散文
<LI>其他
</OL>
<TD colspan="2" valign="top">
<P align="center"> (7) 流年
<P align ="center">孤独的树
<TD width="24%" valign="top">
<P align="center"> 问卷调查
<FORM. method="POST" action="investigate.asp">
<P align="left">我喜欢;
<INPUT type="checkbox" name="C1" checked>小说
<INPUT type="checkbox" name="C2">散文
<INPUT type="checkbox" name="C3">其他
<P>性 : 别:
<INPUT type="radio" name="R1 ">
<INPUT type="radio" name="R1 ">
<P align="center"><INPUT type="submit" value="确定">
<INPUT type="reset" value="重写">
</FORM>
</TABLE>
</BODY>
</HTML>
第3题:
认真阅读以下关于网页制作和网页编程的内容,回答问题1至问题5。
一、网页制作
[说明]
某网络资讯公司用ASP实现了一个用于手机销售信息查询的网页,主页文件名为“index.html”,其内容如下所示,网页的效果如下图所示。
<html>
<head>
<title></title>
</head>
<frameset cols="198,*" border=0>
<frame. name="side" src="side.html" scrolling="No">
<frameset rows="96,*"border=0>
<frame. name="top" src="top.html" scrolling="No">
<frame. name="main" src="main.asp" scrolling="Auto">
</frameset>
</frameset>
<body>
</body>
</html>
二、动态网页编程
[说明]
下图是网页在Ⅲ浏览器上运行后的效果图。下表是手机信息数据表结构。
[main.asp文档的内容]
<html>
<body bgcolor="ffffff" background="bg1.gif" text="000000">
<table border="0" cellpadding="0" cellspacing="0" width="100%"><left>
<!-以下为实现按手机型号搜索功能的部分-->
<form. name="form. 1" method="post" action="main_search.asp">
<div align-"left">
<table width="400" border="0">
<tr>
<td align="right" width="120">请输入<font color="ff0000">型号</font>关键字:</rd>
<rd align="left" width="40">
<input name="Searchtxt" type="text" id="Searchtxt"></td>
<rd colspan="2" align="leff">
<input type="submit" name="Submit" value="搜索">
</td></tr>
</table>
</div>
</form></left>
</table>
<table>
<!-以下为浏览手机信息部分功能-->
<CENTER>
<%dim searchtext
searchtext=Request.Form("Mode 1")
'从数据库中读数据
exec="select * from mod order by Type ASC"
set conn=server.createobject("adodb.connection")
dbpath=server.mappath("mod.mdb")
conn.open "PROVIDER=Microsoft.jet.OLEDB.4.0;data source="&dbpath
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,3
<!--省略关于分页功能的代码>
%>
<div align="right">
<table border="1" width="100%">
<tr>
<th width="20%"><font color="996633" size="2">品牌</font></th>
<th width="20%"><font color="996633" size="2">型号</font></th>
<th width="20%"><font color="996633" size="2">参考价格</font></th>
<th width="40%"><font color="996633" size="2">功能描述</font></th>
</tr>
</table><br>
<% do while NOT rs.EOF and rowcount>0%>
<div align="right">
<table border="1" width="100%">
<tr>
<td align="center" width="20%"><font size="2"><%=rs("Brand")%></font>
</td>
<td align="center" width="20%"><a href="<%=rs("Tvpe")%>.asn"><font size=
"2"><%=rs("Type")%></font></a>
</td></td>
<td align="center" width="20%"><font size="2'><%=rs("Price")%></font>
</td></td>
&n
第4题:
该网站查询商品网页search.htrnl的部分代码如下,请根据该页面和数据库shop.mdb中的表prouducts将search.asp的部分代码补充完整。 search, html: …… <form. method="POST"action="search.asp"> <p>请输入商品名称<input type="text" name="name" size="20"> <input type="submit">确认 …… </form> search, asp …… Pname=Request ("name") sql="Select * From (18) Where productname="& (19) Set rs=conn. (20) (sql) ……
备选答案: A.shop B.name
C.open D.Execute
E.prouducts F.Pname
第5题:
关于ASP说法不正确的是(44)。
A.ASP主要是服务器端脚本
B.ASP只能运行VBScript脚本
C.ASP可以在IIS中运行
D.ASP.DLL用于ASP文件的执行
第6题:
阅读下列说明,回答问题1至问题3。
【说明】
某电子商务网站主页如图6-2所示:
以下是该网站主页部分的HTML代码,请根据图6-2将(1)~(5)的空缺代码补齐。
<html>
(1)非凡商务网站首页(2)
<!--(3)file="include/header.asp”-->
<table width="784" >
<tr >
.
.
.
<for…>
<td width="45%">
<input type="text" size="15" maxlength="15"(4)="关键字“ >
<select name="action" >
<option value="1"(5)>商品名称</option>
<option value="2 ">商品类别< / option>
<option value="3" >商品简介</option>
<option value=" 4 ">详细说明< / option>
</select>
<input type="submit" value="立即查询" >
<input type="button" value="高级查询" nClick="location.href=' search.
asp ' ">
</rd>
</form>
</tr>
</table>
</html>
第7题:
请根据图2-13网页的显示效果,将ASP程序中(2)、(5)、(7)、(8)、(9)空缺处的代码补充完整。
A.Trim (request("item")) B.rs_item.movenext
C. rs.movenext D. <!--include file="conn.asp" -->
E. select * from data where item="&item_type&"
F. <td width="43"height="30"align="center"><%=rs ("Brand") %></td>
G. <td width="43"height="30"align="center"><%=rs ("hits") %></td>
第8题:
请认真阅读以下网站建设的技术说明,结合网页显示的效果图,根据要求回答问题1~问题4。
【说明】
某出版社图书搜索网页使用ASP语言实现,文件名为“index2.asp”。用Ⅲ浏览器打开该网页后的部分显示效果如图1-18所示。
【index2.asp文件的内容】
<html>
(1) 飞思--出版.专业.权威.智育(计算机原理.技术.应用/数码.艺术/设计/少儿/动漫) (2)
<!-- (3) file="include/header, asp"-->
<table width="784">
<tr>
...
<form. ... >
<td width="45%">
<select name="action">
<option value="1"(4)>书名</option>
<option value"2">作者</option>
<option value="3">ISBN 号</option>
<option value="4">出版日期</option>
</select>
<input type="text" size="15" maxlength="15" (5)="关键字">
<input type="(6)"value="Go!" >
<input type="(7)"value="高级检索" nClick="location.href='search.asp'">
</td>
</form>
</tr>
</table>
</html>
根据图1-18网页的显示效果图,请将index2.asp文件中(1)~(7)空缺处的内容填写完整。
第9题:
请根据网页显示的效果图(如图14-4所示),将HTML文本中(n)处的解答填于相应的解答栏内。
[说明]
<html>
<head>
<!-- TemplateBeginEditable name="doctitle" -->
<title>Untitled Document</title>
<!-- TemplateEndEditable -->
<meta. http-equiv="Content-Type" eontent-"text/html; charset=gb2312">
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
<!-- TemplateParam name="BodyBackgroundColor" type="color" value="FFFFFF" -->
<!-- TemplateParam name="FooterColor" type="color" value="CCCCCC" -->
<!-- TemplateParam name="ImageTitleColor" type="color" value="CCCCCC" -->
<!-- TemplateParam name="Footer" type="boolean" value="true" -->
<style. type="text/css">
<!--
body {
background-color: FFFFFF;
}
-->
</style></head>
<body marginwidth="0" marginheight="0" leffmargin="0" topmargin="0">
<br>
<table width="45%" border="0" cellspaeing="2" cellpadding="4" align="center">
<tr bgcolor="@@(ImageTitleColor )@@">
<td height=-"20"><!-- TemplateBeginEditable name="ImageTitle" -->
<div align="center">图片浏览(日落) </div>
<!-- TemplateEndEditable --x/td>.
</tr>
<tr>
<td width="60%" height="169" align="center"> <!-- TemplateBeginEditable name="Image" -->
<IMG nClick=over(this) title=放大 (1) name="image" width="318" height="137" (2) (3) ><!-- TemplateEndEditable --></td>
</tr>
</table>
<br>
<hr width="55 %" noshade size="1">
<hr>
<!-- TemplateBeginEditable name="Navigation" -->
<table width="63%" border="0" cellspacing="0" cellpadding="4" align="center">
<tr>
<td width="20%" align="right"><nobr><a href="">(4); First</a>|<a href="">(5);
Previous</a></nobr></td>
<td width="20%" align="center"><nobr><a href="">(6)</a>|2| <a href="">3</a>
|<a href="">4</a> | <a href="">5</a></nobr></td>
<td align="left" width="20%"><nobr><a href="">Next ></a>|<a href="">Last
(7); </a></nobr></td>
</tr>
</table>
<!-- TemplateEndEditable -->
</body>
</html>
第10题:
阅读下列说明,根据网页显示的效果图,回答问题 1至问题 3。
【说明】
某咨询公司对外提供行业研究报告,其客户分为银卡、金卡及 VIP客户,行业研究报告级别分为A、B和C三类,分别对应 VIP、金卡及银卡权限。行业研究报告访问权限定义如下:不同级别用户可访问同级别及低级别研究报告,但不能访问高级别的研究报告。 用 ASP 实现该用户区分服务系统,用 IE 打开该咨询公司的行业研究报告网页文件
“Report.html”后的效果如图5-1所示。
【Report.html文档的部分内容】
<html>
<head>
<title>行业研究报告列表</title>
</head>
<body>
<table width="95%" border="0" align="center" cellpadding="2" cellspacing="1"
bgcolor="A8D9EC">
……
<tr>
<td colspan="4" align="center">行业咨询报告列表</td>
</tr>
<tr>
<td align="center" bgcolor="FFFFFF">报告名称</td>
<td align="center" bgcolor="FFFFFF">关键字</td>
<td align="center" bgcolor="FFFFFF">报告格式</td>
<td align="center" bgcolor="FFFFFF">发布时间</td>
<td align="center" bgcolor="FFFFFF">客户级别</td>
</tr>
<tr>
<td align="center" bgcolor="FFFFFF"> <A HREF=
"read.asp?clientlevel=C&docid=3213">2010-2015年中国餐饮业市场前景及投资战略咨询报告
</a></td>
<td align="center" bgcolor="FFFFFF">餐饮、市场预测、投资</td>
<td align="center" bgcolor="FFFFFF">PDF</td>
<td align="center" bgcolor="FFFFFF">2009年1月</td>
<td align="center" bgcolor="FFFFFF">银卡</td>
</tr>
<tr>
<td align="center" bgcolor="FFFFFF"><A HREF=
"read.asp?clientlevel=B&docid=2213">2010-2015年中国移动电话行业市场深度调研及投资预测
报告</a></td>
<td align="center" bgcolor="FFFFFF">移动电话、投资预测</td>
<td align="center" bgcolor="FFFFFF">PDF</td>
<td align="center" bgcolor="FFFFFF">2009年9月</td>
<td align="center" bgcolor="FFFFFF">金卡</td>
</tr>
<tr>
<td align="center" bgcolor="FFFFFF"><A HREF=
"read.asp?clientlevel=A&docid=2216">2010-2015年中国铜铁钼行业市场深度调研及投资预测报
告</a></td>
<td align="center" bgcolor="FFFFFF">铜铁钼、市场调研、投资预测</td>
<td align="center" bgcolor="FFFFFF">PDF</td>
<td align="center" bgcolor="FFFFFF">2010年3月</td>
<td align="center" bgcolor="FFFFFF">VIP</td>
</tr>
</table>
</body>
</html>
【Read.asp文档的内容】
<html>
<body>
<%
if request.cookies("register")<>"true" then
response. (1) "register.asp"
end if
%>
<%
Set conn=Server.CreateObject("ADODB. (2)")
Set rs=Server.CreateObject("ADODB. (3)")
conn. (4)="Driver={Microsoft Access Driver (*.mdb)};Uid=;Pwd=;DBQ="&Server. (5)
("database/client.mdb")
conn.open()
%>
<%
dim sql
sql ="select * from permission where clientID=" & request.cookies("clientID")
set rs=conn. (6) (sql)
%>
<%
if rs("Level")="VIP" then
response.cookies("docid") = Request.querystring("docid")
response.redirect "showreport.asp"
end if
if rs("Level")="GOLD" then
If Request.querystring("ClientLevel") = "A" then
response.redirect " (7) "
else
response.cookies("docid") = Request.querystring("docid")
response.redirect " (8) "
end if
end if
…省略部分代码…
%>
<%
rs.close()
%>
</body>
</html>
【问题1】(9分)
从以下备选答案内为程序中(1)~(6)处空缺选择正确答案,并填入答题纸对应的
解答栏内。
(1)~(6)备选答案:
A. connection B. close C. recordset D. command
E. Open F. Run G. Execute H. Dim
I. MapPath J. redirect K. ConnectionString
(1)J或redirect
(2)A或connection
(3)C或recordset
(4)K或ConnectionString
(5)I或MapPath
(6)G或Execute
试题五分析
本题考查考生对HTML和ASP语言的掌握程度,是比较传统的题目。
【问题1】
问题1主要考察ASP对数据库的常用操作以及网页重定向方法。
第(1)处是进行网页重定向操作。因此选择redirect。
第(2)处是建立数据库联接对象,因此选择connection。
第(3)处是建立数据集对象,因此选择recordset。
第(4)处是数据库的连接信息,因此选择ConnectionString。
第(5)处是数据库的路径信息,因此选择MapPath。
第(6)处是执行SQL语句操作,因此选择Execute。
第11题:
试题五(15分)
阅读下列说明,回答问题1至问题3,将解答填入答题纸的对应栏内。
【说明】
某网站采用ASP+SQL Server开发,系统的数据库名为gldb,数据库服务器IP地址为202.12.34.1。打开该网站主页,如图5-1所示:
【问题1】(8分,每空1分)
以下是该网站主页部分的html代码,请根据图5-1将(1)~(8)的空缺代码补齐。
<html>
……
<!-- (1) file="include/header.asp"-->
<table width="784" >
<tr>
……
<form……>
<td width="45%">
<input type=" (2) "size="15" maxlength="15" (3) ="关键字">
< (4) name="action">
<option value="l">商品简介</option>
<option value="2">商品类别</option>
<option value="3" (5) >商品名称</option>
<option value="4">详细说明</option>
(6)
<input type=" (7) "value="立即查询" >
<input type=" (8) "value="高级查询"onClick="location.href='search.asp'">
</td>
</form>
</tr>
</table>
……
</html>
【问题2】(2分,每空1分)
该网站采用ASP编写程序代码,在ASP内置对象中,application对象和session对象可以创建存储空间用来存放变量和对象的引用。
如果在页面中设置访客计数器,应采用上述的 (9) 对象:如果编写购物车组件,应采用上述的 (10) 对象。
【问题3】(5分,每空1分)
以下是该网站进行数据库连接的代码conn.asp,请根据题目说明完成该程序,将答案填写在答题纸的对应位置。
<%
set conn= (ll) .createobject("adodb.connection")
( 12) .provider="sqloledb"
provstr"server= (13) ;database= (14) ;uid= xtgl;pwd=xtg1123"
conn. (15) provstr
%>
第12题:
一个文件夹名称叫Parent,其下有一个叫做test.asp的文件,和一个名为Child的文件夹。Child下有一个名为default.htm文件,想在default.htm中作一个连接,链到test.asp。以下正确的是:()
第13题:
认真阅读下列说明,根据网页显示的效果图,并解释其中用下划线标出的语句的含义。
[说明]
某娱乐公司用ASP实现了一个用于点播电影的网页,主页文件名为“index.asp”,网页运行的效果如下图所示。程序中使用的Acess数据表结构如下表所示。
[conn.asp文档的内容]
<%
dim db,conn,connstr
db="film.mdb"
set Corm =server. CreateObject("ADODB.Connection")
connstr="provider=microsoft.jet, oledB.4.0;data source="& server. MapPath("data/"&db&"")
conn. Ooen connstr 第(1)处
%>
[index. asp文档内容]
(2)
<html>
<head>
<title>电影</title>
<style. type="text/css">
<!--
td { font-size: 12px; line-height: 17px }
body { font-size: 12px; line-height: 17px }
p { margin-top: lpx; margin-bottom: lpx }
a:link { text-decoration: none; color: black }
a:visited { text-decoration: none; color: black }
a:active { text-decoration: none; color: blue } 第(3)处
-->
</style>
</head>
<body lefimargin="0" topmargin="0">
<!--include file="heaD.asp"-->
<div align="center"> 第(4)处
<table>
<td height="30" width="367">
<%sql="select * from item"
set rs_item=server, createobj ect("adodB.recordset")
rs_item, open sql,connstr, 1,1
response.write "<p><b><IMG nClick=over(this) title=放大 src=images/dot 1.gif><a hre=index.asp>全部电影</a> "
do while not rs_item, eof
response.write "<IMG nClick=over(this) title=放大 src=images/dot1.gif borde=0><a href=index.asp?item="&rs_item
("name") &">"&rs_item("name")&"</a> "
(5)
loop 第(6)处
response.write "</b> "
rs_item.close %>
</td>
</table>
</div>
<div align="eenter">
<% dim item_type
item_type= (7)
if item_type="" or item_type="全部电影" then
sq1="select * from data"
else
sql=" (8) "
end if
set rs=server, createobject("adodB.reeordset")
rs.open sql,connstr, 1,1
%>
<table>
<tr>
<rd width="125" background="imagesfog.gif"height="30">
<IMG nClick=over(this) title=放大 border="0" src="images/biao_le ft.gif" width="15" height="15">影片名字</td>
<td width="115" baekground="images/bg.gif"height=-"30" align="center">播放</td>
<rd width="64" background="images/bg.gif"height="30" align="center"> 电影类型</td>
<td width="58" baekground="images/bg.gif"height=-"30" align="eenter">播放格式</td>
<td width="43" baekground="im?ges/bg.gif"height"30"align="center">点击</td>
<td width "70" baekground="imagesfog.gif"height="30" align="eenter">加入日期</td>
<rd width="73" baekground="images/bg.gif"height="30"align="eenter">推荐度</td>
</tr>
<%do while not rs.eof%>
<tr>
<rd width "125" height="30" > <IMG nClick=over(this) title=放大 border="0'' src="images/dian.gif'> <%=rs
("name")%></td>
<td width="115" height="30" align="cente"><a href="">点播</td>
<rd width="64" height="30" al
第14题:
阅读下列网站建设的技术说明,结合网页显示的效果图,根据要求回答问题1~问题5。
【说明】
以下是用ASP实现了一个网络收藏夹网页,用于保存用户感兴趣的Web网页地址。用IE打开网页文件“index.asp”后的效果如图4-14所示。程序中使用的Access数据表结构见表4-8。
【index.asp文档的内容】
<% @language="VBscript" %>
<%
set conn=server. (1) ("Adodb.Cormection")
provider="Provider=Microsoft.Jet.OLEDB.4.0;"
path="Data Source="& Server.MapPath("main.mdb")
connstR=provider & path
conn.open connstr
%>
<html>
<head><title>网络收藏夹</title></head>
(2)
<center>
<%
set rs=Server.CreateObject("Adodb.RecordSet")
sql="select * from address"
rs.open() sql,conn,1,3
if Request("name")="" or Request("url")="" then
Response.write("内容填写不完整")
else
rs.addnew
rs(1)=request("name")
rs(2)=request("URL")
rs(3)=request("category")
rs.update
end If
%>
<table width="500" border=-"1" cellpadding="0" cellspacing="0" bordercolor="00FCFF">
<tr><td>序 号</td><td>名 称</td><td>类 别</td></tr>
<% rs.movefirst
for j=1 to ts. (3)%>
<tr>
<td><%=j%></td>
<td><a href="<%=rs("url")%>" target="blank"><%=rs("name")%></a></td>
<td><%=rs("category")%></td>
</tr>
<% rs.movenext
(4)%>
</table><br>
<form. method="post" name="new" id="new" action="index.asp">
<table width="300" border="1" cellpadding="0" cellspacing="0" bordercolor="FF00CC">
<tr>
<td width="61">名 称:</td>
<td width="223" align="left"><input name="name" type="text" id="name">*</td>
</tr>
<tr>
<td>超链接:</td>
<td align="left"><input name="URL" type="text" id="URL">*</td>
</tr>
<tr>
<td colspan="2">类别:</td>
</tr>
<tr>
<td colspan="2"><textarea name="category" rows="5" id="disc"></textarea></td>
</tr>
<td colspan="2">*为必填项目</td>
</table><br>
(5)
</form>
<%
rs.close
conn.close
%>
</center>
</body>
</html>
请从以下供选择的答案中为index.asp文档程序中(1)~(5)处空缺部分选择正确答案。
(1) A.CreateObject B.Connect C.ExecuteSQL D.Open ()
(2) A.<body> B.<html> C.<head> D.<table>
(3) A.number B.recordnumber C.count D.recordcount
(4) A.skip B.end for C.next D.loop
(5) A.<input type="submit" name="add" value="添加">
B.<input type="post" name="add" value="添加">
C.<input type="submit" name="添加" value="add">
D.<input type="post" name="添加" value="add">
第15题:
试题五(共15分)
阅读下列说明,回答问题1至问题3,将解答填入答题纸的对应栏内。
【说明】
某公司用ASP+Access数据库开发了库存查询系统,该系统用户登录界面如下:
【问题1】
该系统采用B/S三层结构,请根据B/S三层结构的工作过程,完成下图:
(1)~(4)备选答案:
A.Web服务器
B.数据库
C.浏览器
D.数据库服务器
【问题2】
该系统用户登录界面文件名为login.asp,用户输入的数据由check.asp文件判断。下面是login.asp的部分代码,请根据题目说明,补充完成。
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>查询系统</title>
<script. language="JavaScript">
<!--
(5) chk(theForm)
{
if(theForm.admin_name.value = ="")
{
alert(“请输入管理帐号!”);
theForm.admin_name.focus();
return (false);
}
if(theForm.admin_pass.value == "")
{
alert("请输入管理密码!");
theForm.admin_pass.focus();
return (false);
}
retum (6) ;
//-->
</script>
</head>
<body>
<table cellSpacing=l ceIIPadding=5 width=460 border=0>
<FORM. action="(7) ?action=login" method=post nSubmit="return chk(this)">
<tbody>
……
<tr>
<td align=right width=60 height=30>用户名: </td>
<td height 30><input type= (8) name=admin name></td></tr>
<tr>
<td alignrightheight 30>密&nbsp; 码: </td>
<td height 30><input type= (9) name=admin_pass></td></tr>
<tr>
<td align=right>验证码: </td>
<td><input maxLength=4 name=VerifyCode><img src="yz.asp" bordeF'0'
onClick "this.src='yz.asp'"alt='点刷新验证码'/></td></tr>
<tr align middle>
<td colSpan=2 height=40><input type= (10) value="提交”>
<input class=btntype="(ll)" value="取消"
></td>
……
</body>
</html>
(5)~(11)备选答案:
A. password B. reset C. check.asp D. true
E. text F.submit G. function
【问题3】
下面是登录系统中check.asp的部分代码,请根据login.asp和题目说明,补充完成。
……
<%
Usemame=trim(request("admin_name"))
Password=trim(request(" (12) "))
set rs=server.createobj ect(" adodb.recordset")
sql="select * from admin where Usemame='"&Username&"'and
Password='"&md5(Password)& "'"
( 13) . open sql,conn,1,3
if rs. (14) then
response.write "<center>" &Username&"对不起,用户名、密码有误,重新输入"
else
……
session("admin_name")=request("admin_name")
response. (15) "index.asp"
end if
……
%>
(12)~(15)备选答案:
A. rs
B. redirect
C.eof
D. admin_pass
第16题:
阅读下列说明,根据网页显示的效果图,回答问题1至问题4。
【说明】
以下是用ASP实现的一个网络论坛系统。用IE打开网页文件index.asp后的效果如图5-1所示。
【index.asp文档的内容】
<%
set db=server.createobject ("Adodb. Connection")
db. (1) "Dbq=" & server.mappath("data/bbs.mdb") & ";Driver={Microsoft
Access Driver (*.mdb) }"
%>
<html>
<body>
<form name="form1" method="post" action="aaa.asp">
<table border="0" bgcolor="0000FF" width="800" cellpadding=0 align=
"center">
<tr>
<IMG nClick=over(this) title=放大 src="images/logo.gif" width="190" height="94" />
</tr>
<tr bgcolor="E1F3F4" height="40">
<td>
用户名<input type="text" name-"user_id" size=13 class="input">
密码<input type="PassWord" name="password" size=13 class="input">
<input class="inputbutton" type="submit" value="登 录" name=
"Submit">
<input class="inputbutton" nClick="window.open ('bbb.asp', '_self')" type=
"button" value="注 册"
name="register">
</td>
</tr>
</table>
</form>
<table border="0" bgcolor="0000FF" width="800" align="center">
<%
'打开记录集,显示所有论坛栏目
dim rs,strSql
strSql="eelect * from forum"
set rs=db. (2) (strSql)
Dim no '该变量用来显示图片
no=0
do while Not (3)
no=no+1
%>
<tr bgcolor="E1F3F4" height="60" valign="middle">
<td width="10%" align="center" bgcolor="FFFFFF">
<a href="ccc.asp?forum_id=<%-re("ID"}%>"><IMG nClick=over(this) title=放大 src="images/<%=no%>.gif"
border="0"></a>
</td>
<td width="40%" align="left" bgcolor="FFFFFF">
<a href="ddd.asp?forum_id=<%=rs("ID")%>"><%=rs("forumname")%>>></a>
</rd>
<td width="20%" align="left" bgcolor="FFFFFF">共有<%=rs("forumcount") %>
篇文章
</td>
<td width="20%" bgcolor="FFFFFF">版主:
<%=rs("manager") %>
</rd>
</tr>
<%
rs. (4)
loop
db.Close
Set db=Nothing
%>
</table>
</body>
</html>
从以下备选答案中为程序(1)~(4)处空缺选择正确答案,并填入对应的解答栏内。 (1)~(4)备选答案: (1) A.open B.run C.execute D.Dim (2) A.open B.ran C.execute D.Dim (3) A.db.Bof B.db.Eof C.rs.Bof D.rs.Eof (4) A.90 B.movenext
C.skip
第17题:
假设连接的数据记录集当前指向的记录如下:
写出以下ASP代码经过IIS服务器解释后的结果。
<a href="<%=rs("url")%>" target="_blank"><%=rs("name")%></a>
第18题:
假设连接的数据记录集当前指向的记录见表4-9。
写出以下ASP代码经过IIS服务器解释后的结果。
<a href="<%=rs("url")%>" target="_blank"><%=rs("name")%></a>
第19题:
阅读以下网站建设的技术说明,结果网页显示的效果图,根据要求回答问题1~问题3。
【说明】
某大学利用VOD视频服务系统提供教学课件点播服务。该视频服务系统用ASP语言编程实现,主页文件名为“index.asp”,部分网页运行的效果如图2-13所示。程序中使用的Access数据表结构见表2-8和表2-9。
【conn.asp文档的内容】
<%
dim db,conn,connstr
db="vod.mdb"
set Conn=server.CreateObject ("ADODB.connection")
connstr="proyider=microsoft.jet.oledb.4.0;data source=" &server.MapPath ("data/"&db&"")
%>
【index.asp 文档的内容】
(2) <!--第(2)处 -->
<html>
<head>
<title>视频服务系统</title>
<style. type="text/css">
<!
td {font-size:12px;line-height:17px }
body {font-size:12px;line-height:17px }
p { margin-top:1px;margin-bottom:1px }
a:link {text-decoration:none;color:black}
a:visited {text-decoration:none;color:black}
-->
</style>
</head>
<body leftmargin="0" topmargin="0">
<!--5nclude file="head.asp" -->
<table>
<td height="30" width="367">
<%sq1="select * from item"
setrs_item=server, createobjiect ("adodb.recordset")
rs_iterm.open sq1,connstr, 1,1
response.write"<p><b><IMG nClick=over(this) title=放大 src=images/dot1.gif><a href=index.asp>全部节目</a> "
do while not rs_item.eof
response.write "<IMG nClick=over(this) title=放大stc--images/dot1.gif botder=-0><a href=index.asp?item="&rs_item ("name")
&">"&rs_item ("name") A"</a> "
(5) <!-- 第(5)处 -->
response.write "</b> "
rs hm.close%>
</td>
</table>
</div>
<div align="center">
<% dim item_type
item_type= (7) <!-- 第(7)处 -->
if item_type="" or itcrn_type ="全部节目" then
sq1="sclect * from data"
else
sq1=" (8) &
第20题:
假设连接的数据记录集当前指向的记录见表6-10。
写出以下ASP代码经过IIS服务器解释后的结果。
<td align="center" width="20%">
<a href="<%=rs ("Type") %>.asp"><font size="2"><%=rs("Type") %></font></a>
第21题:
阅读一下说明,回答问题1至问题3,将解答填入答题纸的对应栏内。 【说明】 某留言板采用ASP+Access开发,其后台管理登录页面如图4-1所示,留言板页面如图4-2所示。
【问题1】(8分) 以下是该留言板后台管理登录页面的部分html代码,请根据图4-1将(1)-(8)的空缺代码补充完整。 <html> ….. <hera> <title>留言板管理登录</title> </head> <body topmargin=”0”marginheight=”0”> <br> <form method=”post” ______(1)____=”chklogin.asp”> <table border =”0” width=”750” align=center cellspacing=”2” cellpadding=”6”> <tr> …….. <td align=”center”>用户名; <input type=” _____(3)____ ”name=”UserName” size=”20”> </td> </tr> <tr> <td alige=”center”>密 码; <input type=”___(4)___” name=”Password”> </td> </tr> <tr> <td align=”center”>验证码; <%dim num1,num2 Randomize DO White Len(num2)<4 Num1=CStr(Chr(57-48)*rnd+48) (5)=num2&num1 (6) (7)(”verifycode”)=num2 %> <input type=”text” name=”Verifycode”><b><span><%=session(”verifycode”)%></span> </b> </td> </tr> <tr> <td align=”center’> <p> <input type=”(8)”name=”Submit’ value=”登录”> </P> …… </html> (1)-(8)的备选答案: A.submit B.action C.text D.</td> E.session F.loop G.num2 H.password 【问题2】(3分) 该留言板数据库采用Access,其数据库名为datA.mdb,留言内容表为content。 请根据留言板要求,在表4-1中给出合适的数据类型。(9)-(11)的备选答案: A.文本 B.备注 C.自动编号 D.日期/时间 【问题3】(4分) 以下是该留言板页面部分代码,请根据题目说明完成该程序,将答案填写在答题纸的对应位置。 <!--include file=conn.asp--> …… <% Set rs2=server.CreateObject(“adodB.recordset”) Rs2.open”select*from__( 12 )____ ” I=0 Do while not rs2.eof I=I+1 Response.Write(“<tr><td><hr><hr><font color=”red“><b>”&__( 13 )____ &“</b>楼 游客 IP:”&rs2(“ip”)& “留言时间:”& rs2(“time”)& ”留言内容↓</font><hr></td></tr></tr><tr> <td align=cener><textarea>“& rs2(” __( 14 )____ ”)& ”</textarea></td></tr>”) Rs2.movenext Loop Rs2. __( 15 )____ 验证码生成 ……. %> <tr valign=middle> <td ”><hr/>我要留言:</td> </tr> ……. ( 12 ) ~ ( 15 ) 的备选答案: A.cont B. close C.content D.I
第22题:
试题五(15 分)
阅读下列说明,根据网页显示的效果图,回答问题 1 至问题 6。
【说明】
以下是用 ASP 实现的一个网络留言系统。用 IE 打开网页文件“index.asp”后的效果如图 5-1 所示。
【index.asp 文档的内容】
<!--include file="conn.asp"-->
<html>
<head><title>留言系统</title></head>
<body>
<%Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Select * From [message] order by id",Conn,1,1
if rs.eof and rs.bof then
(3) .write("<div align='center' class='bg'>没有留言</div>")
end if
i=1
do while (4)
%>
<table width="700" border="1" align="center" >
<tr>
<td height="30"><strong><%= (5) %></strong>
<%=rs("name")%> <%=rs("ip")%> <%=rs("time")%>
<a href="del.asp?del=<%=rs("id")%>" target="_parent">删除</a>
</td>
</tr>
<tr>
<td width="700" height="20"><%=rs("message")%></td>
</tr>
</table>
<%rs.movenext
i=i+1
loop
%>
<table width="700" border="0" align="center">
<tr>
<td><div align="left"><%=rs. recordcount%>条留言</div></td>
</tr>
</table>
<br />
<table width="704" border="0" align="center">
<tr>
<td width="311"><form. id="form1" name="form1" method="post" action="act.asp">
<table width="302" border="0">
<tr>
<td width="302"> 姓名 <input name="name" type="text" class="box"
id="name" size="15" /><p/>
验证码<input name='validatecode' type='text' class="box" size='5'>
<img src='imgchk/validatecode.asp' align='absmiddle' border='0'> </td>
</tr>
<tr>
<td>内容 (6) </td>
</tr>
<tr>
<td height="30"><input type=" (7) " name="tj" value=" 提交留言 " />
<input name="ip" type="hidden" id="ip" value= "<%=
Request.serverVariables("REMOTE_ADDR")%>" /></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<%rs.close %>
</body>
</html>
【问题 1】(2 分)
以下 (1) 属于 ASP.NET 创建的网页程序文件。
(1)A. index.asp B. index.htm C. index.aspx
【问题 2】(2 分)
HTML 文档中的<title>标签用于定义 (2) 。
(2)A. 修改标记 B. 显示标题 C. 元数据
【问题 3】(每空 1 分,共 5 分)
从以下备选答案内为程序中(3)~(7)处空缺选择正确答案,并填入答题纸对应的
解答栏内。
(3)A. request B. response C. application D. session
(4)A. rs.eof B. rs.bof C. not rs.eof D. not rs.bof
(5)A. i+1 B. rs.recordnumber C. rs.recordcount D. i
(6)
A. <table name="message" cols="40" rows="5" id="message"></table>
B. <textarea name="message" cols="40" rows="5" id="message"></textarea>
C. <input name="message" cols="40" rows="5" id="message"></input>
D. <img name="message" cols="40" rows="5" id="message"></img>
(7)A. submit B. text C. post D. radio
【问题 4】 (2 分)
另一个与程序中的语句“rs.eof and rs.bof”等价的语句是 (8) 。
【问题 5】 (2 分)
设置验证码的作用是 (9) 。
【问题 6】 (2 分)
rs.close 语句的作用是 (10) 。
(10)
A. 关闭数据库连接
B. 关闭当前网页
C. 关闭当前数据集
D. 关闭数据提交
第23题:
阅读下列说明,根据网页显示的效果图,回答问题1至问题7。
【说明】以下是用ASP实现了一个网络收藏夹网页,用于保存用户感兴趣的Web网页地址。用IE打开网页文件“index.asp”后的效果如图5-1所示。程序中使用的Access数据表结构如表5-1所示。
【index.asp文档的内容】
<%@LANGUAGE="VBSCRIPT" %>
<%
set conn=server. (5) ("Adodb.Connection")
provider = "Provider=Microsoft.Jet.OLEDB.4.0;"
path="Data Source=" & Server.MapPath("main.mdb"
connstr= provider & path
corm.open connstr
%>
<html>
<head><title>网络收藏夹</title></head>
(6)
<center>
<%
set rs=Server.CreateObject("Adodb.RecordSet")
sql="select * from address"
rs.open() sql,corm, 1,3
if Request("name") = "" or Request("url")="" then
Response.write ("内容填写不完整")
else
rs.addnew
rs(1) =request ("name")
rs(2) =request ("URL")
rs(3) =request ("category")
rs.update
end If
%>
<table width="500" border="1" cellpadding="0" cellspacing="0" bordercolor="FFCC00">
<tr><td>序号</td><td>名称</td><td>类别</td></tr>
<% rs.movefirst
for j=1 to rs. (7) %>
<tr>
<td><%=j%></td>
<td><a href="<%=rs("url")%>" target=" blank"><%=
rs("name")%></a></td>
<td><%=rs("category")%></td>
</tr>
<% rs.movenext
(8) %>
</table><br>
<form. action="index.asp" method="post" name="new" id="new">
<table width="300" border="1" cellpadding="0" cellspacing="0"
bordercolor="FFCC00">
<tr>
<rd width=" 61">名称</td>
<td width="223" align="left"><input name="name" type="text"
id="name" ></rd>
</tr>
<tr>
<td>超连接</td>
<rd align="left"><input name="URL" type="text" id="URL"></td>
</tr>
<tr>
<td colspan="2">类别</td>
</tr>
<tr>
<td colspan="2"><textarea name="category" rows="5" id="disc">
</textarea>
<br>*为必填项目</rd>
</tr>
</table>
<br>
(9)
</form>
<%
rs.close
conn.close
%>
</center>
</body>
</html>
ASP是(1)网页制作技术。
A.动态 B.静态