如何在一台服务器中在线查找有多少用户 [英] how to find how many user in online in one server

查看:126
本文介绍了如何在一台服务器中在线查找有多少用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在一台服务器中在线查找多少用户

OP Edit:我要问我必须从我的服务器在线用户中找到详细信息

添加了OP答复作为对问题的更新.

how to find how many user in online in one server

OP I''m asking i have to find out of my server online users detail

Added OP reply as an update to the question.

推荐答案

1.创建一个名为SessionCount的应用程序对象.
2.处理会话的OnStart和OnEnd方法.
3.在Onstart中,将一个添加到SessionCount应用程序对象.
4.在OnEnd中,减少一个.

这样,您无需每次都轮询数据库.

如果您有多个托管站点并且对象存储在内存中的Web服务器,则此方法可能无法正常工作.在这种情况下,数据库将轮询解决方案.
1. Create an application object say SessionCount.
2. Handle session''s OnStart and OnEnd method.
3. In Onstart, add one to SessionCount application object.
4. In OnEnd, reduce one from it.

This way you will not need to poll the database everytime.

This may not work if you have more than one web servers where site is hosted and objects are stored in-memory. In this case database polling the solution.


尝试枚举服务器上的用户
方法:(几乎)通过C#将Active Directory中的所有内容 [ http://dmitrysotnikov.wordpress.com/2008/07/18/finding -the-latest-logon-time/ [
Try enumerating the users on the server
Howto: (Almost) Everything In Active Directory via C#[^]

Then check their logins ... some info on that here:
http://dmitrysotnikov.wordpress.com/2008/07/18/finding-the-latest-logon-time/[^]

Regards
Espen Harlinn


那是我认为一种只看数据库的方法.

我想您是为用户存储还是保留IsLoggedInbool? :〜
计算您的情况下在线的所有活动用户数.

或花更多时间询问问题,以使成员获得良好的答复.
That is I think a way only to take a look into database.

I suppose that you''re storing or keeping a bool of IsLoggedIn for user ? :~
Count all active that is number of users online in your case.

Or Spend some more time on asking question to get well response by members.


这篇关于如何在一台服务器中在线查找有多少用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆