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
Ïà¹ØÎĵµ£º
HTTP Error 500.19 - Internal Server Error
Ò» Ê×ÏȽâËø
ÅäÖôíÎó: ²»ÄÜÔÚ´Ë·¾¶ÖÐʹÓôËÅäÖýڡ£Èç¹ûÔÚ¸¸¼¶±ðÉÏËø¶¨Á˸ýڣ¬±ã»á³öÏÖÕâÖÖÇé¿ö¡£Ëø¶¨ÊÇĬÈÏÉèÖõÄ(overrideModeDefault="Deny")£¬»òÕßÊÇͨ¹ý°üº¬ overrideMode="Deny" »ò¾ÉÓÐµÄ allowOverride="false" µÄλÖñê¼ÇÃ÷È·ÉèÖõġ£
³öÏÖÕâ¸ö´íÎóÊÇÒòΪ IIS 7.5 ......
1.//µ¯³ö¶Ô»°¿ò.µã»÷תÏòÖ¸¶¨Ò³Ãæ
Response.Write(" <script>window.alert('¸Ã»áԱûÓÐÌá½»ÉêÇë,ÇëÖØÐÂÌá½»£¡')
</script>");
Response.Write(" <script>window.location
='http://www.51aspx.com/bizpulic/upmeb.aspx' </script>");
2.//µ¯³ö¶Ô»°¿ ......
Beyond File | New Company: from Cheesy Sample to Social Platform Scott Hanselman in Lagoon L on Monday at 11:30 AM The web has changed and there's a new way of thinking about your applications. You can't just write some HTML and CSS anymore and expect to be the next Twitter. Hear h ......
ÔÚ
vs2008Ϊasp.net ajaxÌí¼ÓjsÖÇÄܸÐÖª
½ñÌìÕÒÁ˺þã¬ÖÕÓÚ¸ãÇå³þÁË£¬scriptManager¿Ø¼þÖ§³ÖjsÖÇÄܸÐÖª£¬¶ø´ÓÆä¼Ì³ÐµÄtoolkitScriptManager²»Ö§³Ö¡£ÖÁÉÙÔÚ
vs2008b2ÖÐÊÇÕâÑù¡£
ÒªÔÚjsÎļþÖÐÌí¼Óasp.net ajaxµÄjsÖÇÄܸÐÖª£¨ÓëscriptManager¿Ø¼þÎ޹أ©£¬ÔÚjsÎļþµÄ¿ªÍ·Ìí¼ÓÕâÑùÒ»Ðм´¿É£º
//
/<referen ......