题目详情

阅读以下说明,回答问题1至问题3,将解答填入对应栏内。[说明]某公司使用ASP开发商务网站,该商务网站具有商品介绍、会员管理、在线支付、物流管理等功能。该商务网站采用SQL Server数据库,数据库名为business,其中用户表名称为name,其结构如下表所示。

中级软件设计师,章节练习,真题精选

其中Usergrade仅有两个有效值:“m”表示会员,“b”表示非会员。21、该商务网站数据库连接代码如下,请根据题目说明在备选项中选择正确的答案填在对应栏上:<%set conn= (1) . createobject("adodb.connection")conn. provider="sqloledb"provstr="server=127.0.0.1; database= (2) ; uid=sa; pwd=9857452" (3) . open provstr%>备选答案:A.applicationB.businessC.connD.provstrE.nameF.server22、该商务网站只对会员用户开放购物车模块,当非会员用户点击购物车模块的首页链接时,系统跳转至会员注册页面;会员用户点击购物车模块的首页链接时,直接进入购物车模块的首页。其中购物车模块的首页为main.asp,用户登录时的判断页面是ChkLogin.asp,会员注册页面为Register.asp。1. ChkLogin.asp的部分代码如下,请在空(4)~(6)处填写正确的代码。<!--#include file=conn.asp--><%username=replace(trim( (4) ("username")), "'", "")sq1="select * from (5) where Password='"&password&"'andUserName='"&username&"'"rs.open sq1, conn, 1, 1if (6) (ms.bof and ms.eof)thenif password=rs("Password")thensession("Username")=rs("UserName")session("Usergrade")=ms("Usergrade")%>2. main.asp的部分代码如下,请为空(7)~(8)选择正确的代码。<%if (7) <>"m" thenresponse. (8) "Register.asp"end if%><html></html>(7)备选答案:A.session("Username")B.session("Usergrade")C.application("Username") D.application("Usergrade")(8)备选答案:A.cookieB.endC.redirect D.write23、该网站举办购物优惠活动,希望用户打开网站首页时弹出提示窗口。首页Index.asp中部分代码如下,请在空(9)~(10)处填写正确的代码。<html><head><script language="javascript">function win( ) {window. (9) ("yh.html", "newwindow", "height=100, width=400")}</script></head><body (10) ="win( )">…</body></html>

正确答案及解析

正确答案
解析

21、(1)F. server(2)B. business (3)C. conn

22、1.(4)request(5)name(6)not2.(7)B.session("Usergrade")(8)C.redirect

23、(9)open(10)onload

【解析】

21、本题考查电子商务网站开发代码的基本方法。本问题考查Web数据库的连接代码。根据题目说明,该网站采用ASP+SQL Server开发,其数据库名称为business,所以数据库的连接代码为:<%set conn=server.createobject("adodb.connection")conn.provider="sqloledb"provstr="server=127.0.0.1; database=business; uid=sa; pwd=9857452"conn. open provstr%>

22、本问题考查ASP编码的基本方法。用户登录时的判断页面是ChkLogin.asp,其作用在于当非会员用户点击购物车模块首页链接时,系统跳转至会员注册页面;会员用户点击购物车模块首页链接时,直接进入购物车模块的首页。另外,用户表名称为name,所以代码如下:<!--#include file=conn.asp--><%username=replace(trim(request ?("username")), "'", "")sq1="select * from name where Password='"&password&"'andUserName='"&username&"'"rs.open sq1, conn,1,1if not (rs.bof and rs.eof) thenif password=rs("Password")thensession("Username")=rs("UserName")session(”Usergrade”)=ms(”Usergrade”)%>配合ChkLogin.asp页面,购物车模块的首页main.asp需要对session("Usergrade")进行判断,其程序代码如下:<%if session("Usergrade") <>"m" thenresponse. redirect "Register.asp"end it%><html></html>

23、本问题考查JSP脚本的基本知识。根据题目要求,用户打开网站首页时,弹出相应的提示窗口,所以对应的JSP脚本为:<html><head><script language="javascript">function win() {window. open ("yh.html", "newwindow", "height=100, width=400")}</script></head><body onload="win()">…</body></html>

你可能感兴趣的试题

单选题

一台主机的IP地址为202.123.25.36,掩码为255.255.254.0。如果该主机需要在该网络进行直接广播,那么它应该使用的目的地址为( )

  • A.202.123.25.0
  • B.202.123.25.255
  • C.202.123.24.0
  • D.202.123.24.255
查看答案
单选题

在计算机系统的日常维护工作中,应当注意硬盘工作时不能__(2)__。另外,需要防范病毒,而__(3)__是不会被病毒感觉的。

  • A.电子邮件
  • B.硬盘
  • C.U盘
  • D.ROM
查看答案
单选题

有 4 个 IP 地址:201.117.15.254、201.117.17.01、201.117.24.5 和 201.117.29.3,如果子网掩码为 255.255.248.0,则这 4 个地址分别属于3个子网;其中属于同一个子网的是()

  • A.201.117.15.254 和 201.117.17.01
  • B.201.117.17.01 和 201.117.24.5
  • C.201.117.15.254 和 201.117.29.3
  • D.201.117.24.5 和 201.117.29.3
查看答案
单选题

在异步通信中,每个字符包含1位起始位、7位数据位、1位奇偶位和1位终止位,每秒钟传送200个字符,采用4相位调制,则码元速率为()。

  • A.50波特
  • B.500波特
  • C.550波特
  • D.1000波特
查看答案
单选题

在 Windows 中,运行( )命令得到下图所示结果。以下关于该结果的叙述中,错误的是( )。

Pinging 59.74.111.8 with 32 bytes of data:

Reply from 59.74.111.8: bytes=32 time=3ms TTL=60

Reply from 59.74.111.8: bytes=32 time=5ms TTL=60

Reply from 59.74.111.8: bytes=32 time=3ms TTL=60

Reply from 59.74.111.8: bytes=32 time=5ms TTL=60

Ping statistics for 59.74.111.8:

Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

Minimum = 3ms, Maximum = 5ms, Average = 4ms

  • A.该命令使得本地主机向目标主机发送了 4 个数据包
  • B.本地主机成功收到了目标主机返回的 4 个数据包
  • C.本地主机与目标主机连接正常
  • D.该命令用于查看目标主机的 IP 地址
查看答案

相关题库更多 +