<%
Dim NumVisit
' 聲明變量.
NumVisit = Request.Cookies("chunfeng")("totalvisit")
' 檢查用戶來訪問過多少次.
If NumVisit = "" Then
NumVisit = 0
End If
' 如果是第一次來訪,NumVisit 應為空,所以我們將NumVisit設為0.
'*** Display how many times they have
'*** visited your web page.
Response.Write "已有: " & NumVisit "人光臨隨風起舞!"
NumVisit = NumVisit + 1
' 開始計數.
Response.Cookies("chunfeng")("totalvisit") = NumVisit
' 通過他們的浏覽器將新的總計數寫回到Cookie去
Response.Cookies("chunfeng").Expires = "January 1, 2008"
' 指明Cookie到期時間,否則, Cookie在用戶關閉浏覽器時過期,並失去所有我們想用Cookie來儲存的信息.
%>