<!--#include file="config.asp"-->
<%
dim countstr,countconn,countrs,counters,db1
'On error resume next
db1="count.asp"
Set countConn=server.createobject("ADODB.CONNECTION")
CountStr="DBQ="&Server.Mappath(""&dbpath&"")&";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
'CountStr="driver={microsoft access driver (*.mdb)};dbq=" & server.MapPath(db)
countConn.Open CountStr
Set countrs=Server.CreateObject("ADODB.recordset")
countrs.open "select * from counter where counterid=1",countconn,3,3
'锁定ip
if iplock=1 then
counters=cstr(countrs("counter"))
if session("fareastnet_counteruser")<>"fareastnet_counteruser" then
session("fareastnet_counteruser")="fareastnet_counteruser"
application.lock
call addcounters()
application.unlock
end if
else
call addcounters()
end if
countrs.close
Dim countS, counti,countnum
countS=countlong-Len(cstr(counters))
For counti = 1 to countS
if imgpath<>"" then
countnum=countnum&"<img src='"&imgpath&"/0.gif' border=0>"
else
countnum=countnum&"0"
end if
next
for counti=1 to len(cstr(counters))
if imgpath<>"" then
countnum=countnum&"<img src='"&imgpath&"/" & mid(cstr(counters),counti,1) & ".gif' border=0>"
else
countnum=countnum& mid(cstr(counters),counti,1)
end if
next
response.write "<font face='Arial, Helvetica, sans-serif'>"&countnum&"</font>"
'response.write "document.write('"&countnum&"')"
set countrs=nothing
countconn.close
set countconn=nothing
sub addcounters()
countrs("counter")=cstr(countrs("counter"))+1
countrs.update
counters=firstnum+cstr(countrs("counter"))
end sub
%>