数不清客户端连接到服务器 [英] count no. clients connected to the server

查看:73
本文介绍了数不清客户端连接到服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经将ASP.NET与C#一起使用.我想检查有多少个客户端向Web服务器发送请求.我已经将网页部署在IIS服务器中,然后当我使用IIS Web服务器的IP地址从另一台计算机访问此站点时.如何算不算客户端连接到服务器?


感谢advence

i have used the ASP.NET with C# . i want to check how many client send request to the web server . i have deploy the web page in IIS server then when i have accessed this site from the another computer using IP address of the IIS web server . how to count no. clients connected to the server?


Thanks in advence

推荐答案

检查是否可行,它在VB.NET中,但将其转换为C#应该不是什么大问题.

http://www.motobit.com/tips/detpg_wmi-iis-performance/ [ ^ ]

即使我不确定这是否是可靠的方法,也可以利用Global.asax事件来计算已启动的会话数.

选中此项以获取有关Global.asax事件的帮助

http://www.techrepublic.com/article/working-with-the- aspnet-globalasax-file/5771721 [ ^ ]


欢呼
Check if this works, it''s in VB.NET but should not be a big problem getting it to C#.

http://www.motobit.com/tips/detpg_wmi-iis-performance/[^]

also you could leverage the Global.asax events to count the number of session started, even if I''m not sure that this can be a reliable method.

Check this for help with Global.asax events

http://www.techrepublic.com/article/working-with-the-aspnet-globalasax-file/5771721[^]


Cheers


尝试以下链接可能会有所帮助:-

> http://stackoverflow.com/questions/6218401/how- to-count-sessions-in-asp-net-server-application [ http://stackoverflow.com/questions/9495241/next-count-没有客户端连接到服务器 [ ^ ]

如果有帮助,请不要忘记将其标记为答案.
Try these links might be helpful:-

http://stackoverflow.com/questions/6218401/how-to-count-sessions-in-asp-net-server-application[^]

http://stackoverflow.com/questions/9495241/next-count-no-clients-connected-to-the-server[^]

Please don''t forget to mark this as your answer if it helps you out.


in global asax file on Session start event store the value in 

application variable 
                       if(Application["Count"]!=null)
{
       int count=Convert.ToInt32(Application["Count"]);
       count=count+1;
Application["Count"]=count;

}
else

{
Application["Count"]=1;
}


这篇关于数不清客户端连接到服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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