从以下备选答案中为程序中空缺选择正确答案。
试题五
阅读下列说明,根据网页显示的效果图,回答问题。
[说明]
以下是用ASP实现的一个网络留言系统。用IE打开网页文件index.asp后的效果如下图所示。
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"><p><%= (5) </p>
<%=rs("name")%> ;<%=rs("ip")%> ;<%=ms("time")%>
<a href="del.aspdel=<%:rs("id")%>"target:"=parent">删除</a>
</td>
</tr>
<tr>
<td width="700"height="20"><%=rs("message")%></td>
</tr>
</table>
<%ms.movenext
i=i+1
loop
%>
<table width="700"border="0"align="center">
<tr>
<td><div align="left"><%=ms. recordcount%>条留言</div></td>
</tr>
</table>
<br/>
<table width="704"border="0"align:"center">
<tr>
<td width="311"><form id="forml" name="forml" 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>
A.submit
B.text
C.post
D.radio
参考答案:A
解析: 本题主要考查HTML和ASP编程的语法知识。Active Server Pages提供内建对象,这些对象使用户更容易收集通过浏览器请求发送的信息、响应浏览器及存储用户信息。下面简要说明每一个对象。
Application对象:用于给定应用程序的所有用户共享信息。
Reqlaest对象:使用Reqllest对象可访问任何用HTTP请求传递的信息,包括从HTML表格用POST方法或GET方法传递的参数、cookie和用户认证。Request对象使用户能够访问发送给服务器的二进制数据,如上传的文件。
Response对象:用于控制发送给用户的信息,包括直接发送信息给浏览器、重定向浏览器到另一个URL或设置Cookie的值。
Setver对象:提供对服务器上的方法和属性进行的访问。最常用的方法是创建ActiveX组件的实例(Server.CreateObject)。其他方法用于将URL或HTML编码成字符串,将虚拟路径映射到物理路径及设置脚本的超时期限。
Session对象:用于存储特定的用户会话所需的信息。当用户在应用程序的页之间跳转时,存储在Session对象中的变量不会清除;而用户在应用程序中访问页时,这些变量始终存在。也可以使用Session方法显式地结束一个会话和设置空闲会话的超时期限。
ObiectContext对象:用于提交或撤销由ASP脚本初始化的事务。