< %@ LANGUAGE=”VBscript” % >
< %
RequestName = Request.Form(“Name”)
RequestLeaveMeAlone = Request.Form(“LeaveMeAlone”)
If RequestName <ÃÂ >”” or RequestLeaveMeAlone <ÃÂ >”” thenxml:namespace prefix = o ns = “urn:schemas-microsoft-com:office:office” /??
‘ å¨åÂÂä¸Â个页é¢ä¸Âæ£Âæ¥表åÂÂÃ¥ÂÂéÂÂ.
ÃÂ Response.Cookies(“MySiteVisitorName”) = RequestName
ÃÂ Response.Cookies(“MySiteVisitorName”).Expires = #January 01, 2008#
ÃÂ Response.Cookies(“MySiteLeaveMeAlone”) = RequestLeaveMeAlone
ÃÂ Response.Cookies(“MySiteLeaveMeAlone”).Expires = #January 01, 2008#
‘ å¦ÂæÂÂ表åÂÂÃ¥ÂÂéÂÂÃ¥ÂÂå¨,å°±åÂÂ建Cookie,并设置å°æÂÂæ¶é´.
End ifÃÂ ÃÂ
VisitorName = request.Cookies(“MySiteVisitorName”)
LeaveMeAlone = request.Cookies(“MySiteLeaveMeAlone”)
‘ 读åÂÂCookie.
If VisitorName =”” and LeaveMeAlone =”” then
‘ å¦ÂæÂÂç¨æ·æºåÂÂä¸Âä¸ÂÃ¥ÂÂå¨该Cookie,å°±åÂÂ建ä¸Â个表åÂÂ询é®ç¸åÂ
³ä¿¡æ¯.
% >
ÃÂ < html >
ÃÂ < head >
<title>éÂÂé£Âèµ·èÂÂ欢è¿Âä½ !</title>
ÃÂ < /head >
ÃÂ < body bgcolor=”#ccffff” text=”black” link=”navy” vlink=”purple” >
ÃÂ < DIV ALIGN=”CENTER” >
ÃÂ < form action=”index.asp” method=”POST” >
à< H2 >欢è¿ÂÃ¥Â
Â临精彩æÂ¥é£Â< /H2 >
àæ¨çÂÂç½Âä¸Âæµ称æ¯< input type=”text” name=”name” > (æ¨å¯以éÂÂæ©ä¸ÂÃ¥ÂÂçÂÂèÂÂç´æÂ¥ç¹å»“Ã¥ÂÂé“æÂÂé®)
ÃÂ < br >< br >
ÃÂ < input type=”hidden” name=”LeaveMeAlone” value=”x” >
à< input type=”submit” value=”Ã¥ÂÂé” >
ÃÂ < /FORM >
ÃÂ < /DIV >
ÃÂ < /body >
< %
End if
If VisitorName <ÃÂ > “” then
àResponse.write “欢è¿Âæ¨,” & VisitorName & “! è¿Âå¿就æ¯æ¨çÂÂ家!”
‘ å¦ÂæÂÂCookieÃ¥ÂÂç¨æ·åÂÂé½已åÂÂå¨,Ã¥ÂÂæ¾示ä¸Â个欢è¿Â页é¢.
End if
‘ ç»ÂæÂÂÃ¥Â
¶ä½Â代ç Â.
% >
[1]