Track started applications in Windows

后端 未结 2 973
花落未央
花落未央 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: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
    } 
    

提交回复
热议问题