showname.asp
上传用户:comthink
上传日期:2021-05-06
资源大小:1280k
文件大小:3k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

HTML/CSS

  1. <style type="text/css">
  2. <!--
  3. body {
  4. background-color: #9999FF;
  5. background-image: url(lbg.jpg);
  6. }
  7. table {
  8. font-size: 12px;
  9. font-weight: lighter;
  10. color: #000000;
  11. text-decoration: blink;
  12. border: medium none #99FF00;
  13. }
  14. -->
  15. </style>
  16. <table width="100%">
  17. <tr>
  18. <td>
  19. 在线网友
  20. <hr>
  21. </td>
  22. </tr>
  23. <tr>
  24. <td>
  25. <!-- #include file="conn.asp" -->
  26. <%
  27. '定义数组
  28. dim timername()
  29. redim timername(50)
  30. dim timertime()
  31. redim timertime(50)
  32. dim i,n
  33. dim mi
  34. dim ho
  35. '获得当前时间
  36. mi=MINUTE(TIME)
  37. ho=HOUR(TIME)
  38. if len(mi)<2 then
  39. mi="0"&mi
  40. end if
  41. if len(mi)<1 then
  42. mi="0"&"0"
  43. end if
  44. if len(ho)<2 then
  45. ho="0"&ho
  46. end if
  47. if len(ho)<1 then
  48. ho="0"&"0"
  49. end if
  50. nowtime=ho&mi
  51. '将数据库的名单赋值给数组
  52. set rs=Server.CreateObject("ADODB.RecordSet")
  53. sql="select  * from  online  where id ORDER BY id DESC"
  54. rs.open sql,conn,1,1
  55. for i=1 to 50 step 1
  56.      timername(i)=rs("username")
  57.  timertime(i)=rs("onlinetime")
  58.         rs.movenext
  59.     if rs.EOF Then Exit For
  60.     next  
  61. '现在时间与数组时间比较大于2分针,则删除该在线名单
  62. for i=1 to 50 step 1
  63. t=timertime(i)
  64. if clng(nowtime-t)>2 or clng(nowtime-t)=2 or clng(t-nowtime)>10 then
  65. set rsdell=Server.CreateObject("ADODB.RecordSet")
  66. sqldell="delete * from online where username='"&timername(i)&"'"
  67. rsdell.open sqldell,conn,1,3
  68. end if
  69. next
  70. '显示最新在线名单
  71. set rsout=Server.CreateObject("ADODB.RecordSet")
  72. sqlout="select  * from  online  where id ORDER BY id DESC"
  73. rsout.open sqlout,conn,1,1
  74. for i=1 to 50 step 1
  75.      response.Write(rsout("username"))
  76.  response.Write("<br>")
  77.  rsout.movenext
  78.     if rsout.EOF Then Exit For
  79. next
  80.  response.Write("<br>")
  81. for h=1 to 50 step 1
  82.  response.Write("::::")
  83.  response.Write("<br>")
  84. next
  85. '更新自己在线时间,防止被踢出
  86. set rsupdata=Server.CreateObject("ADODB.RecordSet")
  87. sqlupdata="select * from online where username='"&session("username")&"'"
  88. rsupdata.open sqlupdata,conn,1,3
  89. rsupdata("onlinetime")=nowtime
  90. rsupdata.update
  91. '???????????
  92. %>
  93. </td>
  94. </tr>
  95. </table>
  96. <tr>
  97.  <td align="center"><form name=loading>
  98. <table border=0 cellpadding=0 cellspacing=0 width="86%" height="100%">
  99. <tr>
  100.    <TD align="center" valign="top">
  101.    
  102.    <p><input  type="hidden" name=chart size=46 style="font-family:Arial; font-weight:bolder; color:black; background-color:#EAEAEA; padding:0px; border-style:none;">
  103. <br>
  104. <input type="hidden" name=percent size=46 style="font-family:Arial; color:black; background-color:#EAEAEA;text-align:center; border-width:medium; border-style:none;">
  105. <script>var bar = 0 
  106. var line = "||" 
  107. var amount ="||" 
  108. count() 
  109. function count(){ 
  110. bar= bar+0.5 
  111. amount =amount + line 
  112. document.loading.chart.value=amount 
  113. document.loading.percent.value=bar+"%" 
  114. if (bar<99) 
  115. {setTimeout("count()",20);} 
  116. else 
  117. {window.location = "showname.asp";;}
  118. }
  119. </script></p></TD>
  120. </tr>
  121. </table>
  122. </FORM></td>
  123. <td></td>
  124. <tr>
  125. </table>
  126. <!-- START NNR Site Census V5.1 -->
  127. <!-- COPYRIGHT 2004 Nielsen // Netratings -->