Contar el número de hits (pulsaciones)

3957 vistas

Sencillo de la siguiente manera:



csharp
  1. namespace Developers
  2. {
  3.   public class Global : System.Web.HttpApplication
  4.   {
  5.     static public int nbHits;
  6.  
  7.     protected void Application_Start(Object sender, EventArgs e)
  8.     {
  9.       nbHits = 0;
  10.     }
  11.  
  12.     protected void Application_BeginRequest(Object sender, EventArgs e)
  13.     {
  14.       nbHits++;
  15.     }
  16.     //...
  17.   }
  18. }