Online active users counter in ASP.NET
Online active users counter in ASP.NET
With this tool which is written for ASP.NET, it is possible to count the number of online users, members and guest users in web sites.
Installation
The tool installation is very simple and only takes a few minutes.
Step one - Add Reference:
After downloading the attachment, you should add a reference to the project. If you know how to add references please skip this step.
To add the reference, right click on your solution and select "Add Reference" from the menu. Then select the "OnlineActiveUsers.dll" file. Now the reference is added to the solution.
Step two - Change configuration:
Open the "Web.config" file from your project (If this file is absent, right click on your project and from "Add new item", select "Web configuration file"). Then add this code on "web.config" file.
<httpModules>
<add name="OnlineActiveUsers" type="OnlineActiveUsers.OnlineUsersModule"/>
</httpModules>
Note that this code should be placed between "system.web" tags.
Step three - Add some code to global.asax:
Open the "global.asax" file in your project (If this file is absent, right click on your project and from "Add new item", select "Global Application Class"). In the "session_end" event add this code:
OnlineActiveUsers.OnlineUsersInstance.OnlineUsers.UpdateForUserLeave()
If the project is C# the result should be like this:
void Session_End(object sender, EventArgs e)
{
OnlineActiveUsers.OnlineUsersInstance.OnlineUsers.UpdateForUserLeave();
}
After now the tool will count user statistics.
Step four - Access the statics:
To get the statistics, refer to "OnlineActiveUsers.OnlineUsersInstance.OnlineUsers" variable.
Here are some of its important properties:
UsersCount: the number of all online users.
GuestUsersCount: the number of online guest users. This property works only if you have used SetUserOffline and SetUserOnline methods. These methods are explained below.
RegistredUsersCount: the number
相关文档:
最近公司需要开发一个简历导入功能,类似博客搬家或者邮箱搬家,之前抓取信息是利用火车采集器,但是简历导入功能需要用户登陆以后才能获取简历数据,无奈只好自己开发了。
首先是遇到的问题是:如何实现模拟登陆?
我们知道一般的网站都是通过Cookies来维护状态的,我抓的网站也是支持利用Cookies来验证用户的,构造一个 ......
我有一个login.aspx的页面,假如登录成功后就会自动跳转到index.html的框架.
index.html有三个页面,top.aspx,left.aspx,main.aspx,然后left.aspx里面显示用户信息
假如在left.aspx里没有Session的话,会返回login.aspx页面,而不显示index.html页面里的任何一页.
我现在的情况是没有Session的时候还是在i ......
微软已经宣布ASP.NET MVC 2的代码以MS-PL协议发布,MS-PL是一个得到OSI认证的开源协议,ASP.NET MVC基于MS-PL发布,是一个真正的开源框架且没有任何平台限制,也就是说,您可以在mono下使用或开发ASP.NET MVC的相关项目。 可以到ASP.NET MVC 2 RTM Download Details page获取源代码,或者到CodePlex上获取,这个页面是微软官 ......
一般来说winform应用程序解决这个问题起来时很容易的,web应用程序就麻烦一点了。 这里我说说我的解决思路: 一、你必要有联机型居民身份证阅读器一个(带驱动光盘),这里我用的是精伦电子公司的iDR200,并有这个阅读器的开发接口说明。 二、新建一个winform控件项目ReadCardControl,添加一个主类ReadCard 1、 声明dll入口 ......
搜索引擎优化对任何面向公众的网站来说都非常重要,ASP.net 4.0 为此就做了大量改造。这些改进包括如下:
301
永久性重定向
随着时间的迁移,网站的一些页面地址会发生变化,这会导致搜索引擎收录的链接地址、用户收藏的地址失
效。Response.Redirect() 就是解决这个问题的。但是Response.Redirect 有以下问题:
Respo ......