<html>
<head>
 <title>application应用示例</title>
</head>
<body>
<% session("pers")=session("pers")+1%>
标识为<% =session.sessionid %>的用户，第<% =gcounter(session("pers")) %>次访问！
<%
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 )        '先将数值转换成字符串
   for i=1 to len(s)  '取字符串s的每个字节,然后串成<img src=?.gif> 图形标记
      g=g&"<img src="&mid(s,i,1)&".gif align=texttop>"
   next
   gcounter = g
   end if
end function 
%>
<br>你是本站点的第<% =gcounter(application("counter")) %>位访客！
</body>
</html>

