473,566 Members | 2,958 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2395
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******** ********@TK2MSF TNGP15.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******** ********@TK2MSF TNGP15.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
3713
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
5683
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 information at this point so I am also going to post this in a MySQL related group. I will create some designs and post back to the group if I get...
6
2812
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 LOG-OUT BUTTON, but what if a user "logs out" by closing with the X-button ? If I count down the Application("UserCount") in UNLOAD or DISPOSE I...
6
4588
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 get the logged in username? Do I have to disable the anonymous access in IIS? I rather not because the site is running under a certain domain...
2
308
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 possible to do this? Please let me know how to do it. Thanks.
1
6384
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 of every page: Page 1 page footer: Total brought forward= $0.00 Current Page total = $100.00 Grand Total= $100.00
7
2112
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 trace user's leave the portal without proper log-off or sign-out. Every time a user at proper sign-in, a flag is set & account is locked until he...
2
6644
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) Location: class Week5MortgageGUI Week5MortgageLogic allint = logic.allInterest(amount, term, rate); Week5MortgageGUI.java:152:cannot find symbol...
10
13057
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 source files to C:\Users\Tommy\Desktop\build\classes C:\Users\Tommy\Desktop\PlasmaMS PET\SeanSource...
0
7673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7893
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
6263
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1202
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
926
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.