欢迎进入广州凡科互联网科技有限公司网站
全国服务热线
4000-399-000
ASP转化成静态数据网页页面,学习培训CASE的使用
时间: 2021-03-04 12:06 浏览次数:
您如今的部位是:PHP\ASP\JSP\NETform action="calscore.asp?action=do" method="post" name=form1 ... /form !--#include file="connect.asp"-- % if session("logstatus") 1 then % p align="center" font size="5" b 你要沒有登陆,沒
 您如今的部位是:PHP\ASP\JSP\NET form action="calscore.asp?action=do" method="post" name=form1 ... /form
!--#include file="connect.asp"--
% if session("logstatus") 1 then %
  p align="center"
  font size="5" b 你要沒有登陆,沒有支配权访问本页,请先 a href="login.asp" 登陆 /a ! /b /font /p
%
else
'载入login.htm附加的SubjectNo、StudentID及Name主要参数值
Subject=Request("Subject")
StudentID=Request("StudentID")
Name=Request("Name")
********  相对路径和文档的创建 ********************************************************************
'文件格式化时间
Function format(date)
  format=datepart("yyyy",date) "年" datepart("m",date) "月" datepart("d",date) "日 " formatdatetime(date,vbshorttime)
End Function
dim fmonth,fday,fhour,fminute,fsecond
fmonth=month(date)
if len(month(date)) 2 then fmonth="0" month(date) end if
fday=day(date)
if len(day(date)) 2 then fday="0" day(date) end if
fhour=hour(now())
if len(hour(now())) 2 then fhour="0" hour(now()) end if
fminute=minute(now())
if len(minute(now())) 2 then fminute="0" minute(now()) end if
fsecond=second(now())
if len(second(now())) 2 then fsecond="0" second(now()) end if
newspath=year(date) fmonth fday
newsurl=fhour fminute fsecond
putdate=format(now())
if request("action")="do" then
path=server.MapPath("kaoshi")  /.界定的一个文档
set fso=server.CreateObject("Scripting.FileSystemObject")
if fso.FolderExists(path)=false then
fso.CreateFolder(path)
end if
path=path "/" newspath
if fso.FolderExists(path)=false then
fso.CreateFolder(path)
end if
path=path "/" newsurl ".shtml"  /.转化成SHTML网页页面
set ts=fso.OpenTextFile(path,2,true,-2)
******** 转化成HTML网页页面  ***********************************************************************
ts.writeline" html "
ts.writeline" head "
ts.writeline" title " name ""
ts.writeline"," subject ""
ts.writeline" - 考试成绩結果 /title "
ts.writeline" meta http-equiv=""Content-Type"" content=""text/html; charset=gb2312"" "
ts.writeline" link rel=""stylesheet"" href=""css.css"" type=""text/css"" "
ts.writeline" /head "
ts.writeline""
ts.writeline" body bgcolor=""#FFFFFF"" text=""#000000"" "
ts.writeline" table width=""100%"" "
ts.writeline" tr "
ts.writeline" td width=""100%"" "
ts.writeline" h2 "
ts.writeline"" Name ""
ts.writeline",你的考試考试成绩以下表: /h2 "
dim score
score=0
sqlt="select * from 考试题种类"
rst.open sqlt,conn,1,1
do while not rst.eof
tn=rst("id")
tname=rst("name")
ts.writeline" b "
ts.writeline"" tname ""
ts.writeline" /b br br "
sql="Select * From " Subject " where 题型种类=" tn " order by 题型编号"
rs.open sql,conn,2,2
while not rs.eof
 answer=rs("恰当回答")
 select case rs("题型种类")
  case 1:
  selection=Request("No" rs("题型编号"))
ts.writeline rs("题型编号")
ts.writeline"、" selection " br "
  case 2:
  selection=""
  for n=1 to 4
  if not Request("No" rs("题型编号") "-" n)="" then
  selection=selection Request("No" rs("题型编号") "-" n)
  end if
  next
ts.writeline rs("题型编号") 
ts.writeline" 、" selection " br "
  case 3: 
  selection=Request(rs("挑选项1"))
ts.writeline rs("题型编号") 
ts.writeline"、" selection " br "
  case else:
  selection=Request(rs("挑选项1"))
ts.writeline rs("题型编号")
ts.writeline"、" 
ts.writeline" font color=red 未明确得分标准! /font br "
ts.writeline"" selection " br "
end select
if answer=selection then
  score=score+rs("本题成绩")
end if
rs.movenext
wend
rs.close
ts.writeline" br "
rst.movenext
loop
'response.write score
'response.end
ts.writeline" br "
ts.writeline" font color=red 得分: /font "
ts.writeline"" score ""
ts.writeline" br "
ts.writeline" /td /tr /table "
ts.writeline" /body "
ts.writeline" /html "
end if
%
下一篇:没有了


Copyright © 广州凡科互联网科技有限公司 版权所有 粤ICP备10235580号
全国服务电话:4000-399-000   传真:021-45545458
公司地址:广州市海珠区工业大道北67号凤凰创意园