本文介绍了数不清客户端连接到服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经将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
推荐答案
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;
}
这篇关于数不清客户端连接到服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!