Use Global.asax file and add this
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
Application("OnlineUsers") = 0
End Sub
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
Application("OnlineUsers") += 1
End Sub
Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
Application("OnlineUsers") -= 1
End Sub
You need add this in your web.config (in system.web tag):
<sessionState mode="InProc" cookieless="false" timeout="60" />
If you want it in database just place Subroutine in these events like:
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
<strong>AddOnlineUser()</strong>
End Sub
Where AddOnlineUser() is saome public subroutine for manipulatig data.
ManicCW
Junior Poster in Training
95 posts since Nov 2005
Reputation Points: 13
Solved Threads: 11