使用Cookie来跟踪用户

qq602409745

qq602409745

2016-01-29 18:12

使用Cookie来跟踪用户,使用Cookie来跟踪用户
  Source Code:



<%

'*** Keeping track of how many times
'*** a user visits a web page, by
'*** reading and writing cookies.

'*** In this example "asphole" will be
'*** the name of our cookie, and
'*** "totalvisit" will be the 'key'
'*** value we keep track of. You can
'*** have multiple 'keys' for each
'*** cookie.

'*** Declare your variables
Dim NumVisit

'*** Check to see how many times they
'*** have been to your web page.
NumVisit = Request.Cookies("asphole")("totalvisit")

'*** If this is their first visit to
'*** the page NumVisit is blank, so
'*** make the value of NumVisit 0.
If NumVisit = "" Then
NumVisit = 0
End If

'*** Display how many times they have
'*** visited your web page.
Response.Write "Visits to this page: " & NumVisit

'*** Count the visit to the web page
NumVisit = NumVisit + 1

'*** Write the new total back to
'*** the cookie in their browser
Response.Cookies("asphole")("totalvisit") = NumVisit

'*** Specify when the cookie expires.
'*** If you don't, the cookie will
'*** expire when the user closes their
'*** browser, and you'll lose all info.
Response.Cookies("asphole").Expires = "January 1, 2020"

%




-END-


 
展开更多 50%)
分享

猜你喜欢

使用Cookie来跟踪用户

ASP
使用Cookie来跟踪用户

用cookies来跟踪识别用户

PHP
用cookies来跟踪识别用户

s8lol主宰符文怎么配

英雄联盟 网络游戏
s8lol主宰符文怎么配

用户注册及跟踪代码(三)

ASP
用户注册及跟踪代码(三)

JavaScript使用cookie

Web开发
JavaScript使用cookie

lol偷钱流符文搭配推荐

英雄联盟 网络游戏
lol偷钱流符文搭配推荐

用户注册及跟踪代码(一)

ASP
用户注册及跟踪代码(一)

用户注册及跟踪代码(二)

ASP
用户注册及跟踪代码(二)

lolAD刺客新符文搭配推荐

英雄联盟
lolAD刺客新符文搭配推荐

Word将台历摆到电脑桌面

Word将台历摆到电脑桌面

Word 2003:用好比较功能

Word 2003:用好比较功能
下拉加载更多内容 ↓