国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
ASP生成靜態(tài)網頁,學習CASE的用法,以及“權限”的一種控制方法
userphoto

2010.05.11

關注
<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>未確定評分規(guī)則!</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
%>

本文來自: 站長之家(http://www.doozz.com) 詳細出處參考:http://www.doozz.com/View/30/30010102/1457.html
本站僅提供存儲服務,所有內容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權內容,請點擊舉報。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
ASP生成HTML-另一篇
ASP+FSO+框架實現(xiàn)ASP生成htm并分頁的方法(批量)
從此長大‘s Blog◇Welcome to My Blog◇
Wincc VBS操作txt及SQL2005
如何用ASP生成XML數據文檔(RSS訂閱)
可以將文件轉換為vbs語句的vbs代碼
更多類似文章 >>
生活服務
分享 收藏 導長圖 關注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服