Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

who's logged on?

Status
Not open for further replies.

smsinger3

Programmer
Oct 5, 2000
192
US
Is there any way to determine who has processes running on IIS or ASP.NET at any given time? Also, is there a way to kill the processes. It's hard to tell by looking at our database because we use as common id for all access.

Your help is greatly appreciated!

SteveS
 
I am trying to do the same thing (or similar). I have a discussion forum that I want to the members to be able to tell who is logged in at any given time. (And then perhaps a way to IM them but that's for later.)

Did you ever find a solution to this question?

Rich
 
For all who are interested, here is something that I peiced together from a few other classic ASP sites.

Use the Application Variable:

When a user logs in successfully (such as in a Login.aspx page) set up an unique Application variable.
The application variable name could be something different here like an ID value. Also set it to "" when the Login page is opened outside of a postback.

Application(Session("UserName")) = Session("UserName")


In the WhosLoggedIn.aspx page ( I use a table here ) ...


Sub subShowUsers1()
Dim intCnt As Integer = 0
Dim strUser

' set up the table
Dim tHeaderRow As New TableRow()
Dim tHeaderCell As New TableCell()

tHeaderCell.Controls.Add(New LiteralControl("User Name"))
tHeaderRow.Cells.Add(tHeaderCell)
tHeaderRow.BackColor = System.Drawing.Color.Goldenrod
tblUsers.Rows.Add(tHeaderRow)

For Each strUser In Application.Contents
Dim tRow As New TableRow()
Dim tCell As New TableCell()

tCell.Controls.Add(New LiteralControl(strUser))
tRow.Cells.Add(tCell)
tblUsers.Rows.Add(tRow)
Next
End Sub


And in the Global.asax something like ...

Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the session ends
Application.Contents.Remove(Session("UserName"))
Session("UserName") = ""
End Sub

 
Hmm... bad code
Exclude the
Dim intCnt As Integer = 0
it was from an earlier stab at this

and
Dim strUser

should be
Dim strUser as string
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top