% Application("MyName") = "cnbruce" %> |
% Application.Lock Application("NumVisits") = Application("NumVisits") + 1 Application.Unlock %> 你是本頁的第%=Application("NumVisits")%>位訪問者 |
% if Application("NumVisits")9999 then Application("NumVisits")=10000 end if Application.Lock Application("NumVisits") = Application("NumVisits") + 1 Application.Unlock %> 你是本頁的第%=Application("NumVisits")%>位訪問者 |
% if session("visitnum")="" then Application.Lock Application("NumVisits") = Application("NumVisits") + 1 Application.Unlock session("visitnum")="visited" end if %> 你是本頁的第%=Application("NumVisits")%>位訪問者 |
SCRIPT LANGUAGE="VBScript" RUNAT="Server"> ............. Sub Application_OnEnd ............. End Sub ............. /SCRIPT> |
SCRIPT LANGUAGE=ScriptLanguage RUNAT=Server> ............. Sub Application_OnStart ............. End Sub ............. /SCRIPT> |
SCRIPT LANGUAGE="VBScript" RUNAT="Server"> Sub Application_OnStart ..................... End Sub Sub Session_OnStart ..................... End Sub Sub Session_OnEnd ..................... End Sub Sub Application_OnEnd ..................... End Sub /SCRIPT> |
%@ LANGUAGE = VBScript %> % Option Explicit %> Html> title>猜數字游戲/title> body> % '設置頁面不使用緩存 Response.Expires = 0 %> % dim GuessNum on error resume next GuessNum=Request("Number") if GuessNum="" then GuessNum="0" End if GuessNum=Clng(GuessNum) Session("Count")=Session("Count") + 1 if Session("Count") 10 and GuessNum > session("Number") then %> form action="guessNumber.asp"> input type="text" name="Number"> input type="submit" value="提交"> /form> hr> % end if if GuessNum0 or guessNum>100 then Response.write "請輸入1~100之間的整數" elseif GuessNum=0 then session("Count") = 0 Randomize session("Number") = Int(rnd * 100 + 1) Response.write "請輸入1~100之間的整數" elseif GuessNum > session("Number") then response.write "你猜的太大了" elseif GuessNum session("Number") then response.write "你猜的太小了" elseif GuessNum = session("Number") then response.write "祝賀你,猜對了" end if Response.write "br>共猜了" Session("Count") "次" if Session("Count")=10 then Response.write "答案是" Session("Number") end if %> a href="guessnumber.asp?Number=0">重新猜/a> /body> /html> |