⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 online.asp

📁 这个论坛也不错.适合做毕业设计的
💻 ASP
字号:
<%
ip = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
if ip = "" then ip = Request.ServerVariables("REMOTE_ADDR")
strsql = "select * from online where online_ip = '" & ip & "'"
set rs = my_conn.Execute (strsql)
struser = Request.Cookies("User")("Name")
if rtrim(struser) = "" then struser = "游客"
if rs.eof or rs.bof then
  strsql = "insert into online (online_name, online_ip) values ('" & struser & "', '" & ip & "')"
  my_conn.Execute (strsql)
else
   strsql = "update online set online_name = '"&struser& "', Online_LastTime = #" &now()&"# where online_ip = '" & ip & "'"
   my_conn.Execute (strsql)
end if
if struser <> "游客" then
  strsql = "delete from online where online_name = '" & struser & "' and online_ip <> '" & ip & "'"
  my_conn.Execute (strsql)
end if
strsql = "select online_id, online_lasttime from online"
set rs = my_conn.Execute (strsql)
if not (rs.eof or rs.bof) then
do until rs.Eof
  if DateDiff("n",rs("online_lasttime"),now())>OnlineTime then
    strsql = "delete from online where online_id = " & rs("online_id")
    my_conn.Execute (strsql)
  end if
  rs.movenext
loop
end if
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -