TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
viet vo quoc
NA
115
105.1k
Count online person rely ip address and update online person automatic ??
Nov 22 2011 8:53 AM
Hello Friend!
My question is i can count online person by rely the ip address of client ??
My code is i have 1 page .aspx to display online person and the global.asax to increase or reduce online person.This is code in .aspx:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Response.Write("Person online is:");
Response.Write(Application["person_online"].ToString());
}
}
And this is .asax
protected void Application_Start(object sender, EventArgs e)
{
Application["person_online"] = 0;
}
protected void Session_Start(object sender, EventArgs e)
{
Application.Lock();
Application["person_online"] = Convert.ToInt32(Application["person_online"]) + 1;
//Session.Timeout = 1;
Application.UnLock();
}
protected void Session_End(object sender, EventArgs e)
{
Application.Lock();
Application["person_online"] =Convert.ToInt32(Application["person_online"])-1;
Application.UnLock();
}
So when i run my page by 3 browser(firefox,internet-explorer,chrome) -> it displayed 3 person online when i reload page but i think it exactly is 1 not 3. Someone give me the way to process it's good??
And the next problem is Can i update the person online automatic .I mean when i turn off 1 browser that one of 3 browser ->so the person online automatic reduce 1 needn't press F5 or reload page on other browser(other client)??Someone help me.Thanks
Reply
Answers (
0
)
How to write queriestring inside the xml file and how to replace the value of a string in the querystring
How to obtain a cascading text in ASP.NET Autocomplete textbox