<html>
<head>
<title>application应用示例</title>
</head>
<body>
<p><font color="#990000">网站计数器</font>
<p><font color="#ff0000" size="4">
<% session("num2")=session("num2")+1%>
会话标识为<% =session.sessionid %>的用户，
你是第<% =gcounter(session("num2")) %>次访问！</font><br>
<%
if isempty(session("connected")) then
    application.lock 
    application("counter") = application("counter") + 1
    application.unlock
end if 
session("connected") = true

function gcounter(num)
   dim s,i,g
   if isnumeric(num) then
   s = cstr(num )  '先将数值转换成字符串
   '逐个取字符串 s 的每个字节,然后串成<img src=?.gif> 图形标记
   for i = 1 to len(s)
      g = g & "<img src=" & mid(s, i, 1) & ".gif align=texttop>"
   next
   gcounter = g
   end if
end function 
%>
<font color="#0000ff" size="4">你是本站点的第<%=gcounter(application("counter")) %>位访客！</font>
</body>
</html>
