473,239 Members | 1,484 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,239 software developers and data experts.

how to find total current users at site

Hi All,
We have a requirement to display total number of current users using the
site. We want to display only the total no other information. And this value
needs to change dynamically.

Is it possible to do this? Please let me know how to do it.

Thanks.
Jul 23 '05 #1
2 2378
have an application variable that gets incremented on session on start and
decremented on session on end. If you want it dynamic without a postback
you'll need to use something like ajax

http://weblogs.asp.net/mschwarz/arch...07/397504.aspx

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"msnews" <an******@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Hi All,
We have a requirement to display total number of current users using the
site. We want to display only the total no other information. And this
value
needs to change dynamically.

Is it possible to do this? Please let me know how to do it.

Thanks.

Jul 23 '05 #2
That's a difficult number to calculate. You could keep a counter of the
number of sessions, if you are using session state. However, if you have
more than a few users, session state may affect your overall scalability.

There are probably online companies that have set up this infrastructure.
You may want to look to them, and buy the service.

On the other hand, you could write code to count current users. Warning:
this solution is sub-optimal for high-traffic sites. If you have a
high-traffic site, I'd suggest using an HTTP Module to count hits. However,
for the average sites, this will do:

Set up your code to access a singleton where you keep a list of IP addresses
that have accessed your site, and the time of day the hit occurs. Create a
windows service that calls a page on your site once every second as well.
On every hit, see if the IP address is in the list. If not, add it and set
the time. If so, reset to the current time. Then, scan the list, dropping
every IP address that is older than X seconds (I'd suggest 300 seconds).

To display the current number: You can place a control on a page somewhere
that uses XMLHTTP to go back to the server, on a regular basis, and get the
current count from the list. That way, the number will change dynamically.
See Ajax.Net for a control that is already wired to do this.

Good luck

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"msnews" <an******@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Hi All,
We have a requirement to display total number of current users using the
site. We want to display only the total no other information. And this
value
needs to change dynamically.

Is it possible to do this? Please let me know how to do it.

Thanks.

Jul 24 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Xah Lee | last post by:
suppose you want to do find & replace of string of all files in a directory. here's the code: ©# -*- coding: utf-8 -*- ©# Python © ©import os,sys © ©mydir= '/Users/t/web'
5
by: fwells11 | last post by:
Hi there. As you will see from my questions, I am an SQL newb. I dabble but never get to spend enough time to get proficient so base any feeedback on that basis please. This is all theoretical...
6
by: KS | last post by:
I have made a WebForm with log ON/OFF off users. There is a label that shows the total count off users logged on stored in Application("UserCount") It works fine if the users logs out WITH THE...
6
by: John Dalberg | last post by:
I want to automate the process of logging into an intranet. I want to pull out the username of the Windows user logged into the machine running the browser and use the username in my app. How can I...
2
by: msnews | last post by:
Hi All, We have a requirement to display total number of current users using the site. We want to display only the total no other information. And this value needs to change dynamically. Is it...
1
by: CaptainDahlin | last post by:
I know the basics about access reports and putting page totals in the page footers. What I can't figure out is along with the current page total to display the previous page total: At the bottom...
7
by: Kesavan | last post by:
Is there any way to run a function or a code-block whenever the client- server communication breaks off. (ie power-off, browser-crash...) Why I need this is, I want to update a login-table to...
2
by: karinmorena | last post by:
I'm having 4 errors, I'm very new at this and I would appreciate your input. The error I get is: Week5MortgageGUI.java:151:cannot find symbol symbol: method allInterest(double,double,double)...
10
by: CodeNoob | last post by:
please help been working on a project got it down to 5 errors from 100 now i have no idea what to do. Errors: init: deps-jar: Created dir: C:\Users\Tommy\Desktop\build\classes Compiling 306...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.