gusucode.com > ASP+ACCESS在线教育系统设计(源代码+论文) > ASP+ACCESS在线教育系统设计(源代码+论文)\王智_在线教育系统\toc2.asp
<%@ Language = "VBScript" %> <% ' Ensure that this page is not cached Response.Expires = 0 %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>Dynamic Styles</title> </head> <% ' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ' define global resource ' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Dim iLineNum, strToken,fso,theFile,strInitFilePath ' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ' define global resource ' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Dim img_close_folder,img_open_folder,img_node img_close_folder = "image/folder.jpg" img_open_folder = "image/ofolder.jpg" img_node = "image/doc.jpg" strInitFilePath = server.MapPath("./") & "/include/master.tns" strInitFilePath1 = server.MapPath("./") & "/include/lesson.tns" ' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ' define global format string ' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Dim dirfont,nodefont ' dirfont = " style='FONT-FAMILY: Arial; FONT-SIZE: 14px' color=#cc3300" ' nodefont = " style='FONT-FAMILY: Arial; FONT-SIZE: 14px' color=#009999" dirfont = " style='FONT-FAMILY: 宋体; FONT-SIZE: 14px;text-decoration:none;color:#000080'" nodefont = " style='FONT-FAMILY: 宋体; FONT-SIZE: 14px;text-decoration:none;color:#cd5c5c'" ' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ' define global sub ' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ sub MyReadLine() Dim retstring,iValid iValid = 1 do while theFile.AtEndOfStream <> True retString = Trim(theFile.ReadLine) if ( Instr(1, retstring, "/", 1) = 1 ) then ' comment line elseif Len(retstring) = 0 then else strToken = split(retstring,"[@@@]",-1,1) iLineNum = iLineNum + 1 Exit Sub end if Loop end sub sub myLine(Text) Response.Write Text end sub sub DirEnd() myLine "</div>" myLine "</Font>" end sub sub DirBegin(myStyleString,my_Img,mystrLabel,myUrl, myCurLevel, iIsOpen, iIsLast) if iIsLast = 1 then strTmp = "└" else strTmp = "├" end if if myCurLevel = 0 then mySpace = "" end if if myCurLevel = 1 then mySpace = "├" end if if myCurLevel > 1 then mySpace = String(myCurLevel-1,"│") + "├" end if myLine "<font>" myLine "<nobr>" + mySpace + "<img src='"&img_close_folder&"' id=Out"&iLineNum&" style='CURSOR: hand'class=Outline><A href='" + myUrl +"' id=Out" &iLineNum& " target='main' " + myStyleString + "title = '"&mystrLabel&"' class=Outline> "&mystrLabel&"</A><br></nobr>" if CInt(iIsOpen) = 1 then myLine "<div id=Out"&iLineNum&"_d style='DISPLAY: none' >" else myLine "<div id=Out"&iLineNum&"_d >" end if end sub sub myNode(myStyleString, myImg,mystrlabel,myUrl,myCurLevel,iIsLast) Dim strTmp,myTarget if iIsLast = 1 then strTmp = "└" else strTmp = "├" end if if myCurLevel = 0 then mySpace = "" end if if myCurLevel = 1 then mySpace = strTmp end if if myCurLevel > 1 then mySpace = String(myCurLevel-1,"│") + strTmp end if MyComp = StrComp(myImg, "URL", 1) ' Returns 0. if MyComp = 0 then myTarget = "new" else myTarget = "main" end if myLine "<font>" myLine "<nobr>" + mySpace + "<img src='image/" + myImg + ".jpg'><A href='" + myUrl +"' target='"&myTarget&"' " + myStyleString + "title = '"&mystrLabel&"' style='CURSOR: hand'> "+ mystrLabel + "</A><br></nobr>" myLine "</Font>" end sub Sub NewLine() Dim iContinue, tmpToken do while theFile.AtEndOfStream <> True iContinue = 0 tmpToken = strToken call myReadLine() if CInt(strToken(1)) > CInt(tmpToken(1)) then call DirBegin(dirFont,img_open_Folder,tmpToken(4),tmpToken(3), tmpToken(1),tmpToken(0), 0) call NewLine() DirEnd if Cint(strToken(1)) < Cint(tmpToken(1)) then Exit Sub end if iContinue = 1 end if if iContinue = 0 then if Cint(strToken(1)) < Cint(tmpToken(1)) then call myNode(nodeFont,tmpToken(2),tmpToken(4),tmpToken(3), Cint(tmpToken(1)),1) Exit Sub end if if CInt(strToken(1)) = Cint(tmpToken(1)) then call myNode(nodeFont,tmpToken(2),tmpToken(4),tmpToken(3), Cint(tmpToken(1)),0) end if end if loop end Sub Sub InsertSubTree (strFileName) Set fso = CreateObject("Scripting.FileSystemObject") Set theFile = fso.OpenTextFile(strFileName,1,False) Do While theFile.AtEndOfStream <> True call myReadLine() call NewLine() Loop theFile.Close end sub %> <% Dim MyPageCount,Hitme,szHello Set MyPageCount = Server.CreateObject("IISSample.PageCounter") MyPageCount.PageHit HitMe = MyPageCount.Hits If Time < #10:00:00# And Time >= #00:00:00# Then szHello = "早上好!" ElseIf Time < #12:00:00# And Time >= #10:00:00# Then szHello = "上午好!" ElseIf Time < #19:00:00# And Time >= #12:00:00# Then szHello = "下午好!" Else szHello = "晚安!" End If szHello = "["+FormatDateTime(Date, 0)+"]:"+szHello %> <body TOPMARGIN="0" BGCOLOR="#ffffff" bottomMargin="0" leftMargin="2" rightMargin="0"> <table border="1" cellspacing="0" width="100%" bordercolor="#ffffff"> <tr> <td border="1" bordercolor="#BBBBBB" bgcolor="#000080" colspan="2" align="middle" vAlign="center"> <font color="white" style="FONT-FAMILY: 宋体; FONT-SIZE: 14px">请使用IE40版本浏览器</font></td> </tr> <tr> <td width="100%" border="1" bordercolor="#BBBBBB" bgcolor="#FFFFFF" colspan="2" align="left" vAlign="center" style="BORDER-right: #BBBBBB 1px solid; BORDER-bottom: #BBBBBB 1px solid"> <font color="#000080" style="FONT-FAMILY: 宋体; FONT-SIZE: 12px;text-decoration:none"><%=szHello%><br>您是第<font color="#ff0000" style="FONT-FAMILY: 宋体; FONT-SIZE: 12px;text-decoration:none">[<%=HitMe+17800%>]</font>位访客</font></td> </tr> </table> <% call TableHead("网上学习区")%> <table border="0" cellspacing="2" width="100%" style="BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid;"> <% call TableLine("know.jpg", " 首页公告", "main.asp","main") %> <tr> <td width="100%" bgcolor="#FFFFFF" colspan="2" align="left" vAlign="center" style="BORDER-right: #BBBBBB 1px solid; BORDER-bottom: #BBBBBB 1px solid"> <div id="Outline"><% iLineNum = 0 iAbsLevel = 0 InsertSubTree(strInitFilePath1) %> </div><script> <!-- var img1, img2; img1 = new Image(); img2 = new Image(); img1.src = "<%=img_close_folder%>" ; img2.src = "<%=img_open_folder%>" ; function doOutline() { var targetId, srcElement, targetElement, theSameID; srcElement = window.event.srcElement; if (srcElement.className == "Outline") { theSameID = srcElement.id; srcElement = document.all(theSameID,0); targetId = srcElement.id + "_d"; targetElement = document.all(targetId); if (targetElement.style.display == "none") { targetElement.style.display = ""; if (srcElement.tagName == "IMG") { srcElement.src = "<%=img_open_folder%>"; } } else { targetElement.style.display = "none"; if (srcElement.tagName == "IMG") { srcElement.src = "<%=img_close_folder%>"; } } } } Outline.onclick = doOutline; --> </script> </td> </tr> </table> <% call TableHead("教师工作区")%> <table border="0" width="100%" style="BORDER: #000000 1px solid"> <% call TableLine("know.jpg", "公告发布", "teacher/bulletin.asp","main") %> <% call TableLine("know.jpg", "课件维护", "/cicedu/main/thcic/cod_search.asp?strRate=15","main") %> <% call TableLine("know.jpg", "网上答疑", "teacher/problemadmin.asp","main") %> <% call TableLine("know.jpg", "讨论区管理", "/cicedu/main/thcic/cod_Tools.htm","main") %> </table> <!-- --> <% sub TableHead(strLabel) %> <table border="0" cellspacing="0" width="100%" cellpadding="0"> <tr><td colspan="2" height="10" style="BACKGROUND-COLOR: #ffffff"></td></tr> <tr> <td width="75" bgcolor="salmon" align="center" vAlign="bottom" style="BORDER-LEFT: #000000 1px solid; BORDER-TOP: #000000 1px solid"> <font color="#FFFFBB" style="FONT-FAMILY: 宋体; FONT-SIZE: 14px;text-decoration:none"><%=strLabel%></font> </td> <td align="left" bgColor="#ffffff" nowrap style="FONT-FAMILY: 宋体; FONT-SIZE: 14px"> <img src="image/r-corn.gif" WIDTH="18" HEIGHT="20"></td> </tr> </table> <% end sub %> <% Sub TableLine(strPic, strLabel, strURL,strWindow) %> <% Dim strPicRoot %> <% strPicRoot = "image/" %> <tr> <td width="1%" align="left" bgcolor="white" vAlign="center" style="BORDER-right: #BBBBBB 1px solid; BORDER-bottom: #BBBBBB 1px solid"> <A href=" <%=strURL%>" target="<%=strWindow%>"> <img border="0" height="16" src="<%=strPicRoot + strPic%>" width="16"> </a> </td> <td width="99%" align="left" valign="bottom" bgcolor="white" style="BORDER-right: #BBBBBB 1px solid; BORDER-bottom: #BBBBBB 1px solid"> <a href="<%=strURL%>" style="COLOR: #000080; FONT-FAMILY: 宋体; FONT-SIZE: 14px; TEXT-DECORATION: none" target="<%=strWindow%>"><%=strLabel%></a> </td> </tr> <% end Sub %> </body> </html>