% dim num num=request.cookies("visitnum") if num > "0" then num=num+1 Response.write "您已是第"num"次訪問本站點了。" else Response.write "歡迎您首次訪問本站。" num=1 end if response.cookies("visitnum")=num response.cookies("visitnum").expires=date+365 %> |
% For each cookie in Request.Cookies if Request.cookies(cookie).HasKeys =false then Response.write cookie "=" Request.Cookies(cookie) Response.write ("br>") Else for each key in Request.Cookies(cookie) Response.write ("font color=blue>") Response.write cookie ".("key")" "=" Request.Cookies(cookie)(key) Response.write ("/font>br>") next end if next %> |
%@ LANGUAGE="VBSCRIPT" %> % bgcolor = Request.Form("bgcolor") fgcolor = Request.Form("fgcolor") pwd = Request.form("pwd") If bgcolor >"" or fgcolor >"" then Response.cookies("check")("bgcolor") = bgcolor Response.Cookies("check")("fgcolor") = fgcolor Response.Cookies("check")("pwd") = pwd Response.Cookies("check").Expires=#may 01, 2004# End if '接著,讀取cookie bgcolor = request.cookies("check")("bgcolor") fgcolor = request.cookies("check")("fgcolor") pwd = request.cookies("check")("pwd") '如果cookie在訪問者的計算機上不存在,就創(chuàng)建一個表單,詢問相關(guān)信息 If bgcolor ="" and fgcolor ="" and pwd="" then %> HTML> HEAD> /HEAD> body> DIV ALIGN="CENTER" > Form action="check.asp" method="POST"> Bgcolor: input type="text" name="bgcolor">BR> Fgcolor: input type="text" name="fgcolor">BR> Password:input type="password" name="pwd">BR> input type="submit" value="Submit"> /Form> /DIV> /BODY> % End if '如果cookie已經(jīng)存在,并且bgcolor存在,就跳轉(zhuǎn)到color.asp。 If bgcolor > "" then Response.Redirect "color.asp" End if %> |
% bgcolor=request.cookies("check")("bgcolor") fgcolor=request.cookies("check")("fgcolor") pwd=request.cookies("check")("pwd") %> %response.write("body bgcolor="bgcolor">font color="fgcolor">")%> 你的密碼是: %response.write(" "pwd" ")%> |