一个在VBSCRIPT中读取COOKIE的程序函数
类别: ASP教程
function cookievalue(pcook)
lhowlong=len(pcook)
lwhereis=instr(document.cookie,pcook)
if lwhereis=0 then
cookievalue=false
else
lstartpos=len(document.cookie)-lwhereis-lhowlong
lstartstring=right(document.cookie,lstartpos)
do
lchar=left(lstartstring,1)
if lchar=";" then
cookievalue=lendstring
exit do
else
lendstring=lendstring & lchar
if len(lstartstring)=1 then
cookievalue=lendstring
exit do
else
lstartstring=right(lstartstring,len(lstartstring)-1)
end if
end if
loop
end if
end function
lhowlong=len(pcook)
lwhereis=instr(document.cookie,pcook)
if lwhereis=0 then
cookievalue=false
else
lstartpos=len(document.cookie)-lwhereis-lhowlong
lstartstring=right(document.cookie,lstartpos)
do
lchar=left(lstartstring,1)
if lchar=";" then
cookievalue=lendstring
exit do
else
lendstring=lendstring & lchar
if len(lstartstring)=1 then
cookievalue=lendstring
exit do
else
lstartstring=right(lstartstring,len(lstartstring)-1)
end if
end if
loop
end if
end function
- 上一篇: 利用GLOBAL.ASP定时执行ASP
- 下一篇: 用ERR.RAISE自定义错误信息
-= 资 源 教 程 =-
文 章 搜 索