其实很多源码都有的
下面是以前看到过的(某个博客的)
Dim Guest_IP
Guest_IP=Replace(Request.ServerVariables("HTTP_X_FORWARDED_FOR"),"'","")
If Guest_IP=Empty Then Guest_IP=Replace(Request.ServerVariables("REMOTE_ADDR"),"'","")
'站点统计代码
IF Session("GuestIP")<>Guest_IP Then
Dim Guest_Agent,Guest_Refer,Guest_View,Guest_User
Guest_Agent=Trim(Request.ServerVariables("HTTP_USER_AGENT"))
Guest_Refer=Trim(Request.ServerVariables("HTTP_REFERER"))
Guest_View=Trim(Request.ServerVariables("path_info"))
if memName<>Empty then
Guest_User=memName
else
Guest_User="Guest"
end if
Conn.ExeCute("INSERT INTO blog_Counter(coun_IP,coun_Agent,coun_Refer,coun_User,coun_View) VALUES ('"&Guest_IP&"','"&Guest_Agent&"','"&Guest_Refer&"','"&Guest_User&"','"&Guest_View&"')")
Conn.ExeCute("UPDATE blog_Info SET blog_VisitNums=blog_VisitNums+1")
SQLQueryNums=SQLQueryNums+2
Session("GuestIP")=Guest_IP
End IF
数据库嘛,自己看代码做吧。