tags:

views:

82

answers:

2

We're trying to put together kiosk solution where we can charge people by hour for applications they use. As such, we need a way to figure out when an application is started, when it is closed and log this information for billing. I am a reasonably experienced .NET programmer so a managed code solution would be great. I have also dabbled in Windows API a little bit so that might work too. Any ideas out there?

+2  A: 

This is simple enough with WMI calls. You can actually catch events from the OS on when an app is started, when it's closed, how long it was running, how much memory it used, etc.

Here is one example of monitoring process creating, deletion, etc.

http://weblogs.asp.net/whaggard/archive/2006/02/11/438006.aspx

Chris Lively
A: 

If you're talking about applications you wrote yourself, just log DateTime.Now on either side of the Application.Run() method:

static void Main() 
{   
    DateTime StartTime = DateTime.Now;
    Application.Run(new frmBilling());
    DateTime EndTime = DateTime.Now;

    //Log information to DB for billing
}
Ian Jacobs