IT码农库

您当前所在位置:首页 > 网络编程 > 编程10000问

编程10000问

如何提示用户打开Cookie?

网络 2006-11-16编程10000问4566
Dim strCookie, strTrystrCookie = Request.Cookies("MyCookie")   strTry = Request.QueryString("Try")      If strCookie = "" Then      ' 检测否是设置了Cookie. If strTry = "" Then     &n...

Dim strCookie, strTry

strCookie = Request.Cookies("MyCookie")  

strTry = Request.QueryString("Try")

     

If strCookie = "" Then     

' 检测否是设置了Cookie.

 

If strTry = "" Then   

         Response.Cookies("MyCookie") = "Set"

' 重定向到这一页面再试.

       

Response.Redirect(Request.ServerVariables("script_NAME")

& "?Try=Yes")

      Else       

     ' 如果没有开启Cookie.

 

 End If 

 Else

 ' 客户端正在接受Cookie.

 

Response.Cookies("MyCookie").Expires = "April 15, 2001"

End If

 

 

大图广告(830*140)