Track started applications in Windows

后端 未结 2 983
花落未央
花落未央 2021-01-21 18:39

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, w

相关标签:
2条回答
  • 2021-01-21 19:08

    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

    0 讨论(0)
  • 2021-01-21 19:09

    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
    } 
    
    0 讨论(0)
提交回复
热议问题