快精灵印艺坊 您身边的文印专家
广州名片 深圳名片 会员卡 贵宾卡 印刷 设计教程
产品展示 在线订购 会员中心 产品模板 设计指南 在线编辑
 首页 名片设计   CorelDRAW   Illustrator   AuotoCAD   Painter   其他软件   Photoshop   Fireworks   Flash  

 » 彩色名片
 » PVC卡
 » 彩色磁性卡
 » 彩页/画册
 » 个性印务
 » 彩色不干胶
 » 明信片
   » 明信片
   » 彩色书签
   » 门挂
 » 其他产品与服务
   » 创业锦囊
   » 办公用品
     » 信封、信纸
     » 便签纸、斜面纸砖
     » 无碳复印纸
   » 海报
   » 大篇幅印刷
     » KT板
     » 海报
     » 横幅

使用COOKIE来跟踪用户

<%

\\\'*** 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"

%>
返回类别: 教程
上一教程: 巧用ASP技术保护DHTML源代码
下一教程: 无组件上传图片至SQL SERVER数据库

您可以阅读与"使用COOKIE来跟踪用户"相关的教程:
· ASP:COOKIE使用指南
· ASP中COOKIE使用指南
· 用户注册及跟踪代码(三)
· 用户注册及跟踪代码(一)
· 用户注册及跟踪代码(二)
    微笑服务 优质保证 索取样品