如何在Flash中处理Cookies?
testcookies.asp
' 检查浏览器是否接受cookies.
<%
strtest = request.querystring("cookietest")
if ucase(strtest) <> ucase("true") then
session("__flashcookietest") = true
' 第一次呼叫.设置session变量.
' 用querystring重定向.
strurl = request.servervariables("script_name")
strquerystring = "?cookietest=true"
response.redirect(strurl & strquerystring)
response.end
else
if session("__flashcookietest") = true then
' 已完成重定向.检查session变量是否包含值.
strout = "cookies=true"
' session变量包含值,因此浏览器接受cookies.
else
strout = "cookies=false"
' session变量为空,浏览器决绝cookies.
end if
end if
response.write(strout)
' 输出到flash.
%>
setcookies.asp
<%
for each item in request.querystring
response.cookies(item) = request.querystring(item)
next
%>
getcookies.asp
' 读取 cookies
<%
for each cookie in request.cookies
strout = strout & server.urlencode(cookie) & "="
strout = strout & server.urlencode(request.cookies(cookie))
strout = strout & "&"
next
response.write strout
%>
上一篇: 龙利鱼是什么,为什么大家这么喜欢吃
下一篇: 如何实现人民币的大写转换?