您现在的位置: 军旅同心 >> 读书赏析 >> 学习园地 >> 电脑网络 >> 技术文章 >> 文章正文
完整的访问统计程序(二 程序篇)
作者:采集员 文章来源:来源于网络 点击数: 更新时间:2005-9-10 13:56:18
p;  sub writeYearStatic(userid)
   i=0
   dim strArray(13)
   for i=1 to  12
     strArray(i)=cStr(i) & "月"
   next
   i=0
   strSQL="select sum(num) as ccount from YearStatic where userid='" & userid & "'"
   set rst=openRst()
   rst.open strSQL,conn,3,3
   if isnull(Rst("ccount")) then
     ccount=0
   else
     ccount=Rst("ccount")
   end if
   strSQL="select * from YearStatic where userid='" & userid & "' order by monthid"
   set rst=openRst()
   rst.open strSQL,conn,3,3
   %>
   访问总数<%=ccount%>
     <table border=1 width=100%>
       <tr height=100%>
          <td width=50%><% WriteDateTable 1, 6, strArray ,ccount %></td>
          <td width=50%><% WriteDateTable 7, 12, strArray ,ccount %></td>
       </tr>
    </table>
   <%
   end sub
%>
<%
   sub WriteRecentInfo(userid)
      '显示访问者的浏览器分布
      StrSQL="select top 10 * from accessstat where userid='" & userid & "' order by VisitTime desc"
      set rst=openRst()
      Rst.open StrSQL,Conn,3,1
      %>
      <table border=1 width=100%  align=center cellSpacing=1 cellPadding=1>
          <tr>
             <td width=5% align=center>序 号</td>
             <td width=20% align=center>来访时间</td>                 
             <td width=15% align=center>IP地址</td>
             <td width=15% align=center>所用操作系统</td>
             <td width=15% align=center>所用浏览器类型</td>
             <td width=30% align=center>浏览的上一页</td>
             <td width=0%></td>
          </tr>
         <% for i=1 to Rst.RecordCount %>                   
              <tr>
                 <td width=5% align=center><%=i%></td>
                 <td width=20% align=center><%=Rst("VisitTime")%></td>                                                              
                 <td width=15% align=center><%=Rst("IPAddr")%></td>
                 <td width=15% align=center><%=Rst("UseSystem")%></td>
                 <td width=15% align=center><%=Rst("BrowserType")%></td>    
                 <td width=30% align=center><a HREF=<%=Rst("LastPage")%>><%Response.Write Rst("LastPage")%></a></td>
                 <td width=0%></td>
               </tr>
               <% Rst.MoveNext%>              
     <% Next %>
      </table>    
<%
   end sub
%>
<%
   sub WriteBrowserInfo(userid)
      Set Rst=OpenRst()
      strSQL="select count(*) as VisitCount from AccessStat where userid='" & userid & "'"
      Rst.open strSQL,Conn,3,1
      TotalVisit=rst(0)
      StrSQL="select BrowserType,count(BrowserType) as visitcount from AccessStat where userid='" & userid & "' group by BrowserType order by VisitCount desc"
      Set Rst=OpenRst()
      Rst.open StrSQL,Conn,3,1
      %>    
      <table border=1 width=100%  align=center cellSpacing=1 cellPadding=1>
          <tr>
             <td width=5% align=center>序 号</td>
             <td width=15% align=center>所用浏览器类型</td>                 
             <td width=40% align=center>访问比例尺表示</td>
             <td width=15% align=center>访问次数</td>
             <td width=5%></td>
          </tr>
          <%for i=1 to     Rst.RecordCount %>
             <tr>
                <td width=5% align=center><%=i%></td>
                <td width=15% align=center><%=Rst("BrowserType")%></td>
                <!--
                <td width=15% align=center><%=Rst("VisitCount")%></td>                                                      
                <td width=10% align=center><%=FormatNumber(CInt(Rst("VisitCount")/TotalVisit*10000)/100,true,true)%>%</td>
                 <td width=40% align=left><img src=bar.gif width=<%=(Rst("VisitCount")/TotalVisit)*300%> height=10></td>
                -->
                <td><%setbar Rst("VisitCount"),TotalVisit %></td>
                <td width=5% ></td>
             </tr>
         <%Rst.MoveNext%>
          <% Next %>    
         &nb

上一页  [1] [2] [3] 下一页


 
免责声明:作品版权归所属媒体与作者所有!!本站刊载此文不代表同意其说法或描述,仅为提供更多信息。如果您认为我们侵犯了您的版权,请告知!本站立即删除。有异议请联系我们。
文章录入:烟灰缸    责任编辑:烟灰缸 
网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
| 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 | 网站公告 | 管理登录 |