六月婷婷综合激情-六月婷婷综合-六月婷婷在线观看-六月婷婷在线-亚洲黄色在线网站-亚洲黄色在线观看网站

明輝手游網中心:是一個免費提供流行視頻軟件教程、在線學習分享的學習平臺!

控制用戶登陸到網站與顯示在線用戶下文

[摘要]下面是global.asa的內容: Sub Application_OnStart ' Delete all saved session information, in case of a crash set objADO = Server.CreateObject("ADODB...

下面是global.asa的內容:

Sub Application_OnStart
' Delete all saved session information, in case of a crash
set objADO = Server.CreateObject("ADODB.Connection")
sDatabasePath = Server.MapPath("/databases")
sConnection
= "filedsn="&sDatabasePath&"\readwrite.dsn;DBQ="&sDatabasePath&"\sessi
ons.mdb;"
objADO.Open(sConnection)

sUpdateCmd = "delete * from session;"
objADO.Execute(sUpdateCmd)
' Close the database down again
objADO.close
set objADO=Nothing

' Now store the DSN connection string away, so we don't have to look
it up again
Application("sessionDSN") = sConnection

End Sub

Sub Session_OnStart

' Write the session information away into the session database
set session_objADO = Server.CreateObject("ADODB.Connection")
session_objADO.Open(Application("sessionDSN"))
session_sUpdateCmd = "insert into session values
("&Session.SessionID&","
session_sUpdateCmd = session_sUpdateCmd & "'"&Request.ServerVariables
("REMOTE_ADDR")& "',"
session_sUpdateCmd = session_sUpdateCmd & "'"&Request.ServerVariables
("HTTP_USER_AGENT")&"');"
session_objADO.Execute(session_sUpdateCmd)
' Close the database down again
session_objADO.close
set session_objADO=Nothing

End Sub

Sub Session_OnEnd

' Delete the session information from the session database
set session_objADO = Server.CreateObject("ADODB.Connection")
session_sConnection = Application("sessionDSN")
session_objADO.Open(session_sConnection)
session_sUpdateCmd = "delete * from session where
SessionID="&Session.SessionID&";"
session_objADO.Execute(session_sUpdateCmd)
' Close the database down again
session_objADO.close
set session_objADO=Nothing

End Sub

下面是實現功能的一個例子:

<% OPTION EXPLICIT

' currentusers.asp V1.0
' Copyright 1998/99 Bann Consultants [email protected]
' Created 03/11/98 Modified 03/11/98
' On-line documentation at http://www.bann.co.uk/asp/
'
' COPYRIGHT NOTICE
' Copyright 1998-1999 Barry Dorrans All Rights Reserved.
'
' CurrentUsers may be used and modified free of charge by anyone so
long
' as this copyright notice and the comments above remain intact. By
using
' this code you agree to indemnify Barry Dorrans from any liability
that
' might arise from its use.
'
' Selling the code for this program without prior written consent is
' expressly forbidden. In other words, please ask first before you
try and
' make money off of my program.
'
' Obtain permission before redistributing this software over the
Internet or
' in any other medium. In all cases copyright and header must remain
intact
%>
<html>
<title>Current User report</title>
<body bgcolor="#fffaf0">

<h1> Current User Report </h1>

<br>
<table border=0>
<tr><td><p><b>Remote Host</b></td>
<td><p><b>Browser</b></td></tr>
<%

DIM objADO, sDatabasePath, sConnection, sessionRecords
DIM userCount

userCount = 0

SET objADO = Server.CreateObject("ADODB.Connection")
sDatabasePath = Server.MapPath("/databases")
sConnection
= "filedsn="&sDatabasePath&"\readonly.dsn;DBQ="&sDatabasePath&"\sessio
ns.mdb;"
objADO.Open(sConnection)

SET sessionRecords = objADO.execute("select * from session;")

DO WHILE NOT sessionRecords.EOF
userCount = userCount + 1
%>
<tr><td><p><%=sessionRecords("Host")%></td>
<td><p><%=sessionRecords("BrowserType")%></td></tr>
<% sessionRecords.MoveNext
LOOP

sessionRecords.Close
objADO.close
SET sessionRecords = Nothing
SET objADO=Nothing

%>


Session變量的有效期默認為20分鐘,可以通過下面來改變它的默認有效期:
Session.Timeout=(有效期的分鐘數)



主站蜘蛛池模板: 五月婷婷啪啪 | 日本精品视频网站 | 四虎影院国产 | 日本视频中文字幕 | 午夜在线亚洲男人午在线 | 亚洲欧美精品一区二区 | 日韩亚洲欧美一区二区三区 | 香蕉久久a毛片 | 色非网| 日本大片在线播放在线 | 亚洲 欧美 丝袜 制服 在线 | 伊人成影院 | 青娱乐在线视频盛宴 | 欧美桃色视频 | 欧美亚洲国产成人不卡 | 天堂黄色 | 日日干夜夜拍 | 在线免费国产 | 视频在线亚洲 | 四虎永久免费在线观看 | 亚洲人成亚洲精品 | 中文字幕不卡在线高清 | 人与禽交免费网站视频 | 在线亚洲精品自拍 | 亚洲午夜久久久久中文字幕 | 色宅男中文字幕亚洲专区 | 日韩午夜免费 | 日韩在线视频网址 | 热久久这里是精品6免费观看 | 日韩色在线观看 | 欧美视频久久 | 天天做夜夜做 | 亚洲综合色一区 | 青青草原在线新免费 | 欧美自拍三级 | 欧洲三级视频 | 最近最新中文字幕免费的一页 | 亚洲精品福利在线观看 | 日本高清在线不卡 | 求欧美精品网址 | 一二三四影视大全免费观看电视剧 |